filesystem: basic_{,i,o}fstream refactoring.