When the PR_SET_MM_MAP_SIZE is not supported (kernels prior to 3.17) we try to check for older API, but there's a set of bugs in there. This set fixes them all (I hope).