Fixed bug that caused panic if take_lock was called before scheduler init.