Fix merge leftovers
Fix bug where signaling a condvar with no waiters crashes

Fix process_emancipate_children logic to prevent race conditions