Scala: Not a good way to test asynchronous code