Change unsafePerformIO to dupable where permissable.

Ignore-this: 699ceb789d5e46ce6ef4a827eb86b4be

darcs-hash:20140614083454-4d2ae-aa154b1decf93198027e6e03dcac99b68fdf219e
Fix QVariant hooks to not assume pointer is valid.

Ignore-this: 5d4641bb0ef0545fe020fdc0a079d312

darcs-hash:20140723221848-4d2ae-49e7a55b8c01a116f72a76590983f98468e68107
Fix thread safety of logging function.

Ignore-this: 2ea28e0f72602ab6ee73a20e0bc887a

darcs-hash:20140725211037-4d2ae-7f7402bc76ad995abd8a60cd3e0b4b4aca627976