Fix negotiation in stage 10 error

Problem fixed by adding a select() call to implement a timeout,
and retrying writes if needed.
Merge branch 'master' of https://github.com/theqvd/qvd-nx