Move getting the arguments into its own function.
Move loading autodie::exception into a function.

It's a logical step, and it reduces the work Perl_io_error() might do
even when autodie is off.
Fix our $@ protections.

Saving ERRSV doesn't work because it's an SV * which is modified in place.
Using the internals equivalent of { local $@ } instead from perlguts.

Changed the function name to better reflect what it really does.
Reduce the work Perl_io_error does before checking if autodie is on.