sdb module: add backward-compatible support for Python 3.3+

test_db.py doesn't work for currently code already, and I fear it would be a big job to fix it...

All integration tests passed.
This might be worth adding to `compat.py` as `unichr`. Not sure if it is used anywhere else.