Fix bugs and add unit test for TFile/HFile FileAccess impl