Fix non-deterministic unit test

- the latch was before onError is called
- use BlockingObservable and expect the IllegalArgumentException to be thrown