fix for trylock to give up if some other thread holds the lock.