Fixed first emission racing with pre and post subscription.

There was a subtle race between the subscription and emission which delayed the delivery of the first emission if it happened between the pre- and post-subscription of a subscriber. The fix is the same logic used by the BehaviorSubject to avoid the same problem.
I don't understand what this synchronization is doing. We don't synchronize the `onNext` so why would synchronization here help ensure no race?

Shouldn't the `caughtUp` function be used to handle this use case on the first `onNext` to handle any data between `onStart` and `onAdded`?