esmith::db: safely decode DB data to UTF-8 strings. Refs #2786

JSON functions require properly decoded UTF-8 strings to work correctly.