Add Try/Except IOError to Google credentials file

I have got the case where my application can't write this Google credential file.

The file reading is already set as optional with a Try/Except IOError,
so I made optional writing.