Fixed problem with close of lock file for WIN32.