Don't crash on non ascii bytestrings in db params.

Thanks Karen Tracey for the report. Fix #422.