Copy the more efficient HTTP header parser from QtNetwork

The one from QtNetwork is more efficient, since it doesn't use regular
expressions. This also solves a use of uninitialised variables.

error: ‘httpStatusCode’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Change-Id: Id7f203d971564651eb0bd63d3d54d074be947793
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>