Fix segfault where QFCgiConnection destroys the device

The device was already destroyed over the QObject tree.
Make d'tors virtual

Currently not really necessary, but it's future safe.
Fix calculation of 4-byte length of name-value-pair