handle timeouts properly in the repeated (-r) ping mode (this fixes #457)