API tests: fix file handle leak in SBT, thread exhaustion in Travis

I believe I finally have a handle on the multiple problems, and have fixed or worked around them here. What a pain.
I couldn't agree more with your objection to `Thread.sleep` as a general rule. In fact, I've had to make the same point over and over in past lives. UI testing in particular is a minefield of temptation in this area. But in this instance, I would make an exception if it were up to me.

Admittedly, after spending two days or so reading source code and bugs for these broken libraries, I was pretty sick of the problem and just happy to find a workaround.

I have another hack I'm going to try, and ultimately if you insist on the thread-inspection approach I'll do that.

But here's why this particular instance is special:
1. It's the *library* that's sleeping. Whatever I do here, it's going to have the effect of delaying the test until the library's sleep has expired. I don't need any work to happen, just for the library's sleep to expire. That also means we won't speed up the tests by waiting for the pool to be disposed; in fact the tests will take longer, since at a one-second delay they're overlapping somewhat.
2. Furthermore, I don't need the timing to be right in every case (or indeed in any case). I just need enough spread to avoid having *every* test's thread pool alive at the same time, which was causing the JVM to run out of threads on some runs.
3. We're not testing any condition after the sleep, so it doesn't affect correctness. That is, if we don't wait for long enough, no particular test will fail. We'll just start getting the random "cannot spawn thread" errors.

Integration tests suck.