MB-11363 Reset btree pointers to NULL after freeing their memory.
MB-11363 Reset btree pointers to NULL after freeing their memory.

There is a case where couchstore_rewind_db_header API is followed
by couchstore_close_db API. As both APIs free the memory used by
B-Trees (id-tree, seq-tree, local-doc-tree), their pointers should
be reset to NULL right after memory deallocation.

Change-Id: I486e057f793ddc0e20bd63bae690c6ebd4cadfb8
Reviewed-on: http://review.couchbase.org/38768
Reviewed-by: Michael Wiederhold <a17fed27eaa842282862ff7c1b9c8395a26ac320@couchbase.com>
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Tested-by: Chiyoung Seo <fcffc23db27b19ee4ebba46695ee6b50e09216a2@couchbase.com>

abhinavdangeti/couchstore,couchbaselabs/couchstore,vmx/couchstore,vmx/couchstore,jimwwalker/couchstore,vmx/couchstore,jimwwalker/couchstore,jimwwalker/couchstore,couchbaselabs/couchstore,abhinavdangeti/couchstore,abhinavdangeti/couchstore,couchbaselabs/couchstore