Handle corrupted lock files better fix #2566