Update devel_glfw3.1 branch to current GLFW and fix Retina support.

Please review the two commits separately.