Fix dynamic borrow check errors.

This reduces the scope of the borrow on `family` to the single FFI call that
needs it.