This stops the ui being blocked while the resource is opened. The wait ensures that resources are reclaimed when the process finishes while aerc is still running.