Fix race in MemTable::Unref

MemTable::Unref is decrementing the refcount on the MemTable, but after
the decremnt it tests the actual in-memory refcount for 0 rather than
the result returned from the atomic decrement. This means that even if
it doesn't drop the last reference, it can see the result of someone else
dropping the last reference, resulting in a double free.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>