prefs: remove idle handler when shutting down

(integrated from trunk branch change 5b9d4eb by Todd Whiteman <toddw@activestate.com>)