Improved test for holds on a lock