Update to latest pugl; fix more win32 api issues