Add additional type check for legacy query

On dados.gov.br I get a HTTP 403 Forbidden on some datasets that are
listed through /api/rest/dataset. Without the check in this commit, the
string becomes part of the JSON array written to the dump file.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>