Fix lock file re-close issue.