Fix bad response to malformed URIs

Tests revealed a bug when users provided a bad request URI. Rather than
just severing the socket connection this returns an HTTP 400 response
for anything not recognized and then closes the connection cleanly.

BugzId: 27664
Merge pull request #2 from cloudant/27664-fix-bad-uri-response

Fix bad response to malformed URIs