Switch from couch_upr to couch_upr_client implementation

The couch_upr_client uses multiplexing. That makes it possible
to handle the immediate stopping of the updater more gracefully.
The current way of trying to drain the socket is error prone and
occasionally makes the tests fail.

Change-Id: I8eb9e8fb79eaad8076703f590eee355e2e06e4b9
Reviewed-on: http://review.couchbase.org/34330
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
MB-10297: Use a new record type for docs retrieved through UPR

Use the #upr_doc{} record which is defined in couch_upr.hrl, rather than
the #doc{} record defined in couch_db.hrl. The internal representation
of a document shouldn't leak to the outside. A document you retrieve
through UPR should contain exactly that information.

For this change it was also needed to split the couch_upr.hrl header into
a separate file for the type specs. Else there would be clashes, as
couch_upr.hrl now needs to be included in couch_set_view_updater.erl in
order to be able to use the #upr_doc{} record.

Currently the data type isn't transmitted through UPR, hence there's no
simple way for the view engine to know whether the item is JSON or binary.
A test for it could be added, but it's a better way to implement it on the
UPR stream produce side.

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