win32: fixes for higher optimization levels