Fix location-header for documents with newlines in the name

Properly urlencode the Document-Id in the Location-field of the
header

Based on a patch from Sean Bartell <wingedtachikoma@gmail.com>
COUCHDB-708

This patch is covered by tests in https://github.com/apache/couchdb/pull/275