NCBC-550: Thread A is disposing of Bucket while thread B is still using it

This patch fixes a couple of bugs/race conditions and ensures that the IBucket
is disposed by the last reference to it.

Change-Id: Ifcb48bc0a4ff121b96c7202dc9ffeccc1bd29354
Reviewed-on: http://review.couchbase.org/39935
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>
Reviewed-by: Brett Lawson <brett19@gmail.com>