MB-9730 Add `guided_purge_btree` API

This API modifies a btree based on guide functions,
purge_kp and purge_kv. It walks the btree and evaluates
each KV node or KP node using the corresponding guide function
and removes the node if the guide function signals for purging.

Change-Id: Iab42ac7260f3714b51259a1cb956e3ab9e23073e
Reviewed-on: http://review.couchbase.org/30404
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>