Always percent-encode location headers.

If we don't, stupid servers that don't do it themselves can hurt us badly.

Resolves #1360.