Import unsafePerformIO from System.IO.Unsafe

This used to live in Foreign, but importing it from there is
deprecated. We now import Foreign.Safe directly for everything else,
and unsafePerformIO from its new home in System.IO.Unsafe.
Support for functions giving GErrors.

Functions that accept a GError argument are now processed properly,
and the corresponding exception will be thrown when the GError is
non-null.