Clamp the timeout of select to the user-set timeout.