This is a workaround for locking on window

Locking does currently not work on windows.

It also fixes the crash on windows.