Don't leave timeout goroutines hanging until the timeout expires.

Thanks to johnsto@ for noticing the problem.
Added Travis CI configuration.