For use in freopen tests, add various support/ helper interfaces for use in checking file contents. Tested for x86_64.