Update db.py

In python3.X, we need to convert map object to list, to be able serialize it.

Issue #431