Fixed pyglet bug on macos.

Fixed pyglet bug on macos following hint in
https://groups.google.com/forum/#!topic/pyglet-users/4H8luPX69zc