Fix two problems in mark & sweep GC.
- Fencepost bug in computing 'max_used_varyobj_page' if the final page
has no object header on it (so its generation mask is 0).
- Flip the order of operations in the page fault handler.
In the order as it was, if GC happened in between setting the dirty bit
and making a page writable, then the GC might simply clear the bit,
as no write has actually occurred yet, only to resume at the system call
which unprotects the page. This made a writable page not marked dirty.