macosx_events: fix null dereference on uninit

Bug introduced by commit 6fb020f5. It doesn't always happen, since it is
caused by the playloop and cocoa UI code running in separate threads.

Fixes #398.
cocoa: make borderless window resizable

Fixes #399