Add reason for failure of file IO

In a few places I found that the reason for failure of file open was not being reported.
For consistency I've updated this to match the die/self->throw calls where $! is reported.

Thank you.