windows: Added lockf function and lock PID file