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.
Now imagine that the Subject receives an onNext and onCompleted in quick succession; if the subscription is delayed between onStart and onAdd, the subscriber will never be notified as there can't be any further events to trigger caughtUp.

Synchronized resolves the race for the replayObserver: it protects the first indicator. If the subscribing thread gets in there first, it starts to replay existing and incoming events until it gets some "break" and the regular caughtUp can pick up. If the emitter thread gets in there first, it will behave as a regular caughtUp and the subscriber thread does nothing.