MB 7629: Add more sanity checks in id btree key/value decode

This is to deal with some rare/corner cases where the buffer length is
too small for id btree key/value decode.

Change-Id: I68bd59d6a00783e853d5dd99edbb35f707565fb7
Reviewed-on: http://review.couchbase.org/25800
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>