PaX/GrSecurity compatibility improvements

I wrote a couple of patches to improve PaX/GrSecurity compatibility after a Gentoo user reported NULL pointer dereferences on Gentoo Hardened from a PaX/GrSecurity patched Linux 3.7.5 kernel:

https://bugs.gentoo.org/show_bug.cgi?id=457176

See the individual commit messages for a detailed description of the changes.