It turned out that the old code had a race--between decrementing and
testing the reference count and acquiring the lock, another thread could
potentially acquire a reference, release the reference, and then unmap the
data. This still left the reference count as zero, so a second unmap was
attempted. Now, use mmap->addr to detect if the unmap needs to be done or
not which should eliminate this race.