Better error handling in g2p module

This is a small improvement in the error handling code of the `g2p.py` module, so that it won't fail silently anymore in case an error occurs.

I did this because of Issue #232 (and probably #265).