[activerecrod] please review: Allow loading structure dumps from stdin

In https://github.com/rails/rails/pull/29522 I have fixed the code to allow loading structure dumps from stdin (eg.piping directly from unpacker, useful when handing very big dumps).

Please help reviewing, I can rebase if someone likes it.