AsyncObseravableBase: Fix in case of exceptions thrown synchronously by fedeAlterio · Pull Request #2213 · dotnet/reactive

IAsyncObserver<T> OnNextAsync, OnCompletedAsync and OnErrorAsync can all throw exceptions synchronously,
This is not handled correctly in AsyncObseravableBase, and the execution flow will follow a different path of the asynchronous one.

A concrete issue caused by this, is that if a synchoronous exception is thrown inside OnCompleteAsync, AutoDetachAsyncObserver will not Dispose the subscription automatically

Fixes also reentrancy issues when Disposing while in the middle of an On*Async call