Fix scheduling deadlock in case of inter-test locking.