Add function for getting pt entry counts.

This is important because it does so synchronously, which might solve a
lot of issues that have been discovered when running Python with this
allocator.

Also started tests for pagetable.cpp, which currently is uncovered.