Stop auxiliary threads before stopping the world

This prevents a deadlock where for example the finalizer thread was
halted running Ruby code and had a Thread lock. This caused code after
forking to deadlock. By switching these, we make sure that the finalizer
thread stops at a safe point.