adding OP_QUERY rpc exhaust support

Provide suport for exhaust queries

Found a couple of bugs in:
* buffers didn't handle already buffered data well (negative unsigned
  ints
* gridfs files were still on possibly negative min_bytes for readv