added tests for locking around a panic()