Cast $category to an int if it's numeric, to pass the term_exists() check

`term_exists()` does an `is_int()` check (and not `is_numeric()`), so
if `$category` is an integer as a string, the export will fail.

This casts it to an int (if it's numeric) to ensure `term_exists()`
works correctly.