api.c trylock() add missing locklock