Queryport: error handling and inline comments.

Change-Id: I475846f0a7de449d4fb032631948e0a60bceefd3
Reviewed-on: http://review.couchbase.org/42749
Reviewed-by: Pratap Chakravarthy <prataprc@couchbase.com>
Tested-by: Pratap Chakravarthy <prataprc@couchbase.com>