Cast proper fields to `int` when returning from `wp_get_object_terms()`. Add `term_taxonomy_id` and `object_id` to the list in `sanitize_term()` and `sanitize_term_field()`.  

Fixes #17646. Adds unit tests.
Props simonwheatley, dd32, kovshenin.



git-svn-id: https://develop.svn.wordpress.org/trunk@26010 602fd350-edb4-49c9-b593-d223f7449a82