Bugfix: check if lock exists before unlink