Use QSignalSpy instead of waitFor in tst_qpacketprotocol

QTcpServer::waitForNewConnection() blocks the event loop and prevents
the client, that runs in the same event loop, from sending anything.
Also, if the connection is established before waitForNewConnection() is
called we're going to wait for another connection, which will never
happen.

It's not clear if this is actually the cause of the test failures but
blocking the event loop is generally a bad idea and the last change to
the test that actually made a difference to the functionality added
exactly that line, see b36bbe3626bc68ac267d7653fa6408a8f258251d.

Task-number: QTBUG-39655
Change-Id: Ic03a4e7cac78155532588476b99449664c343ee2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>