New deal keeps open facility that detains immigrant families