Prevent IndirectReferenceTable from being outside of kPageAlignment

Due to how we resized the IndirectReferenceTable it could end up being
an unaligned size. On some architectures, this could sometimes cause
issues we would try to madvise a negative length region, causing
crashes. To fix this we changed the IRT to avoid ever having non-page
aligned lengths and changed how we calculate what to madvise slightly.

Test: ./test.py --host
Test: ./test.py --host --debuggable --64 --with-agent $ANDROID_HOST_OUT/lib64/libtifastd.so=ClassFileLoadHook
Test: Manual checks on emulator
Bug: 152421535
Change-Id: I9eb99c750e6b6230998bf8ba314be426ad8c228c
diff --git a/runtime/indirect_reference_table.h b/runtime/indirect_reference_table.h
index b46435d..86b92cf 100644
--- a/runtime/indirect_reference_table.h
+++ b/runtime/indirect_reference_table.h
@@ -381,7 +381,8 @@
     return reinterpret_cast<IndirectRef>(EncodeIndirectRef(table_index, serial));
   }
 
-  // Resize the backing table. Currently must be larger than the current size.
+  // Resize the backing table to be at least new_size elements long. Currently
+  // must be larger than the current size. After return max_entries_ >= new_size.
   bool Resize(size_t new_size, std::string* error_msg);
 
   void RecoverHoles(IRTSegmentState from);