Improve waiting for things to end in (un)installer