wayland: Release input focus when window is destroyed

This fixes a seg. fault on the reopen test because events might occur
after the window is destroyed (for example leave events).
Fixed video modes not being rotated to match CRTC.

Fixes #284.
Quoted all CMake paths with substitution.

Fixes #258.
Use CMake threading variable for Wayland.
Removed link interface no-op.

Closes #327.
Moved XKB header to header variable.
Optimize _glfwInitJoysticks on OS X.

This function used to enumerate all devices and capture all properties
of every device into a dictionary. This takes 180 ms on a MacBook Pro
without external devices and 280 ms with an external keyboard/mouse
attached.

Since we're only interested in a few properties, we can just get them
one by one - this reduces the time to <1 ms.

Note that we still use the dictionary to get the joystick elements.
For unknown reason this is required to get all axes/buttons - without
doing this we don't get any joystick elements in addJoystickElement.

Closes #332.
Merge pull request #333 from ricardomv/fix-reopen

wayland: Release input focus when window is destroyed.
Fix cursor behavior on OS X.

Don't implement resetCursorRects: this occasionally hides the cursor
since an empty cursor is assigned to the window rectangle.  Implementing
this method is not required since OS displays the window cursor
correctly by default.

Don't reset cursor mode when window loses focus: once again, OS handles
this correctly, and this means that the window cursor state is restored
when window gains focus again.
Fixed changing cursor while it's outside window.

We need to invoke both [NSCursor set] and [NSView addCursorRect].

First call is responsible for changing the cursor if it's inside the
view; second call is responsible for keeping the cursor the same if it's
outside.
Cleanup of OS X cursor fixes.

Closes #334.
Fixes #254.
Fixed VC++ warnings.
Added OpenGL Reference pointers.
CMake path quoting fixes.
Added clearing of global struct on terminate.
Merged gamma files into monitor files.
Moved RandR gamma probe to init.
Updated extension headers.
Clarified comment on APIENTRY hack.
Added APIENTRY hack to native header.