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 <mike@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>