Avoid deadlocking in the async example on dispose