gio: Clear error properly to prevent crash

https://bugzilla.gnome.org/show_bug.cgi?id=711070