FIX: Fix Qt cleanup

This allows demos to run on my machine, and tests to pass. @rossant feel free to have a try on your system. @almarklein @lcampagn, this touches the code that we've been dealing with.

Closes #228.