ruby: do not deregister memzone entries from the type and layout maps if the zone is still referenced

When memory_unref got refactored, the delete/unref stages have been
properly guarded in a if(!entry->refcount) block. However, the
memory_types and memory_layout maps were not. This led to memory leaks as
the corresponding zones would not get finally deleted (type info
not available).