Fix locking for wakeup.