Cherry pick commits related to killing the window manager

Bring the does not hang UI automation feature to the z-stream branch.