Refactor abc::file into a hierarchy

Now each OS-native file type has its own implementation class, so each of
them needs no special-case logic.

This also allows to have a separate abc::console_file class, which is
necessary under Win32 to use different read/write API functions.