Fixes elf panic

We have some programs that would hit the partial case, but would also
try to mmap beyond the file size.  When we attempted to zero the rest of
the page, we'd panic.  And that page would never fault in, since it is
beyond the file's limit.

This area is quite a mess.  Most of the code is very old, and related to
half-understood  elf loading rules.