MB-20054: Account for memory alloc/dealloc in unregisterBucket