Separate generic UI finding and locking from event handling (#11506)

This is one step towards support for toggling push on and off on demand
as that functionality requires accessing the UI e.g. when processing
cancel events.

Also ensures ThreadLocal instances are properly set up when handling
push events.

Change-Id: I8ed6bf3bbee5ede0696ed9017e1d9d84db5936b5