Improve UI shutdown

Wait for the actual result of the shutdown call.
Wait indefinitely for the shutdown result, otherwise we get "invalid" success, not aware if there was indeed a shutdown.