Update db.py

In python3.X, we need to convert map object to list, to be able serialize it.

Issue #431
Merge pull request #432 from w-diesel/patch-4

map() returns an iterator on Python 3.