Textinput: Only _destroy() clearButton when present

Fixes gh-7567
Well, mostly because I declare variables that are relevant only to the test that follows. I'd hate to have to declare those variables at the top of the file (as per our style guide), because having them placed so far away from where they're actually used is confusing. However, it's not just for aesthetics. The scoping reflects the fact that the module setup/teardown is not enough to actually gather the information that I need.