MB-9730 Add purge functions for id_btree and view_btree

Implement the purge functions for conditionally purging
btree nodes based on clear_bitmask.

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