fix bug that caused the library to crash when scope is destroyed. 

Fix bug that caused the library to crash when scope is destroyed. 

You can run the unit test to test it. The original code will throw this
```
rootScope:: ends the stream when the is : failed …
  TypeError: 'undefined' is not a function (evaluating 'this.unsubAll()') (2)
```