Add timeout checking code (closes #20)
Force a maximum select() timeout of ~2 seconds

This was done so that connection timeout checks are performed on a more
regular basis. A more "efficient" method is to have each connection
determine the time interval until it would do a timeout check and then to
use that information to produce a new timeout, but that's unnecessarily
complex, especially when this solution works just fine.

I don't know if it's actually 2 seconds or not, and I can't really be
bothered to make this maximum a more concrete limit. Given the purpose
it was implemented for, this patch works perfectly.