raise ValueError in get_db_prep_value when value is of invalid length (fixes #46)