cocoa: simplify the config code and run it on the main thread

This could be dangerous because we initialize the window asynchronously and
return immediately from config, but since the OpenGL context is already
created, this seems to work correctly and doesn't cause weird deadlock cases.
examples/cocoa: set activation policy to mimic nib applications