Increase threading timeout on Travis.

This causes spurious "errors" on builds.
Sleep in thread test using a Condition.

I tried using plain time.sleep, but it seemed to deadlock, so this way
it is.