Encode ranges properly

The index merger needs to convert the query parameters from their
Erlang representation back to the HTTP API one. Ranges use `null`
as a wildcard which is converted to a `nil` in the Erlang world.
This commit makes the proper conversion back.

Change-Id: I471b5a95011b10082ed82d7056dcdaec37966ccc
Reviewed-on: http://review.couchbase.org/42759
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>