fix removing .lock dir if directory is empty