add hasObservers method to Subjects (#1772)

as per https://github.com/ReactiveX/RxJava/issues/1772

SerializedSubject now keeps track of the actual Subject.
BufferUntilSubscriber synchronizes on the state guard.
Merge pull request #1802 from simonbasle/hasObservers

add hasObservers method to Subjects (#1772)