Fix GLFW issues

While checking the GLFW3 branch, I saw two issues:
- Array with the key status can overflow; key mapping was wrong

MacOSX specific:
- Add missing link libraries

This was with GLFW3 build externally; haven't checked the fallback mechanism for the internal GLFW.