Fix HttpWebResponse.ContentType when response has invalid headers
The HttpWebResponse.ContentType property is supposed to return a string value with the response's `Content-Type` header value. Even if the response header is considered non-conformant with RFC7231, the value is returned as-is as received on the wire.
In .NET Core, HttpWebRequest/HttpWebResponse is implemented as a wrapper around HttpClient. HttpClient has a strongly-typed model for headers. The current implementation of HttpWebResponse.ContentType was trying to use the strongly typed header from HttpClient. In cases where the header was malformed, it was returning empty string. This was a difference in behavior from .NET Framework.
The fix is to use TryGetValues() to retrieve the raw response header value for the 'Content-Type' header. This will result in compatible behavior with .NET Framework.
Fixes dotnet/corefx#9433.
Commit migrated from https://github.com/dotnet/corefx/commit/
e0ce0fd8ab9f75583870609a5da26bab916d65e5