Delete fcntl lock file on Unlock; merge common code.
fix windows build