Fix multiple WWW-Authenticate headers

This patch fixes the case with the server trying to negociate the authentication
method and returning multiple WWW-Authenticate headers.
Merge pull request #1803 from hardening/www_authenticate_fix

Www authenticate fix