Fixes #3786

Cleanup the remaining warnings for set-but-unused-variables. Includes r28722, r28723, and r28734.

Reviewed by rhc, along with a few additions to catch the rest of the warnings.