Fix handling of multiple Set-Cookie headers.

Closes GH-1296.