Fixup memory allocation for URL path

Change-Id: I31b42155ec63ea07daebcecd682901ca8239fd9c
Reviewed-on: http://review.couchbase.org/25442
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>