Previously, mmap_find_vma could return addresses not properly aligned
to the target page size. This of course led to all sorts of odd
problems down the road.
The trivial fix, to simply reject the unaligned address and continue
searching the address space by increments of one page, is not a good
idea when there's a 64-bit address space involved. The kernel may well
continue to return the last available address which we've already
rejected while we search upward from e.g. 2**42 from 2**64.
This patch uses a more complex search algorithm that takes the result
of the previous allocation into account. We normally search upward,
but notice 2 consecutive results and start searching downward instead.