Support casting plugin to internal interface

To get access to the internal ICQ interface, one can now write:

Licq::IcqProtocol::Ptr icq = plugin_internal_cast<Licq::IcqProtocol>(
    Licq::gPluginManager.getProtocolPlugin(LICQ_PPID));

Instead of the old way:

Licq::ProtocolPlugin::Ptr icqProtocol(Licq::gPluginManager.getProtocolPlugin(LICQ_PPID));
Licq::IcqProtocol* icq = dynamic_cast<Licq::IcqProtocol*>(icqProtocol.get());

It was neccessary to keep hold of icqProtocol until one was done with icq to be
guaranteed that the protocol hadn't been unloaded. This is now handled
automatically.
qt4-gui: use Qt signals instead of plugin helper to handle signals/events

If a Qt signal is sent to a object that lives in another thread, the signal is
queued in that object's event loop and delivered in that thread.

Since this was what the helper class did, but using a std::queue and a pipe, it
could be removed in favour of the native solution.