Fix leaking couchstore handles

Change-Id: Ib24667fe6c7cbf2c1cf25a20758b1f8157031786
Reviewed-on: http://review.couchbase.org/34394
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>