Metadata sync wasn't matching records appropriately

All metadata in the db was always being removed and then added again, never
updated as it should. The keys were being compared as symbols against
strings.