Fix catching of GError exceptions

Signed-off-by: Jerome Flesch <jflesch@gmail.com>