Synchronize terminalState and subscription logic

- remove the race condition that existed between a subscription coming in while onError/onCompleted was being called