added trylock test; minor fix in lock_if; updated correnctess scripts