Fixed ReplaySubject leak

Fix for issue #939.