Fix w32 build. lock.c must be rewritten