fix timeout being uverwritten by select() on Linux

The spec for select() says that it can overwrite the parameters of timeout.
It does this on linux and this means that if we don't set the value after each call to select then we'll use the wrong value.

Without this I get a busy-waiting cycle under linux.