vm_map_unwire and vm_map_wire_locked have substantial code duplication in the attempt to get the first or next entry not in an IN_TRANSITION state. Define vm_map_get_avail_entry to capture a lot of that common code. Drop some gotos. Change a couple of boolean_t variables to bool. No changes outside of the wiring/unwiring code.