common: open files in ro mode for extent and hole count helpers