Fix buffer overrun error with some proxy servers

In some cases, depending on the proxy server response, the current
implementation of QHttpSocketEngine may write to memory beyond the
allocated buffer size. That will trigger undefined behavior on UNIX
systems and a buffer overrun exception if compiled with visual studio.

Change-Id: I5769d10c56b6a7483d6d94672aa4321287b82651
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>