Fixed issue with mutex thanks to Ivan Mogilko

https://github.com/adventuregamestudio/ags/commit/a1f351ba7a98e243ed1997
8161361a705759fcbd