metadata: fix a memory-leak when adding metadata for folders; entry wasn't freed