Use vectored reads to search for buried headers
Use vectored reads to search for buried headers

Current behavior attempts to read a header at each block, starting at
the eof and working backwards one block at a time. Deeply buried headers
can take a long time to find, depending on the depth of the header,
server load, etc.

This commit changes the behavior so that if the last block in the file
does not contain a header, it switches to using a "vectored" approach
where multiple candidate header prefixes (of 5 bytes) are read in a
single operation, greatly speeding up the search. On a modern linux
system with SSD, we see improvements up to 15x.

COUCHDB-3061

fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,apache/couchdb-couch,apache/couchdb-couch,apache/couchdb-couch,fkaempfer/couchdb,cloudant/couchdb-couch,cloudant/couchdb-couch,cloudant/couchdb-couch