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>
MB-9730 Add unit tests for id and view btree purge functions

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