autotests: add test for 404 error, make tests more robust
- Don't derive from QThread, encapsulate one instead (avoids
moveToThread(this))
- Allow client sockets to connect in any order they want.
Instead of requiring a fixed scenario order, we pick the scenario
corresponding to the first line of the client request