Don't crash with invalid lock file. fix #2407