Introduce io_delay for custo IO delay mechanisms

For now use SDL_Delay of 1ms for the SDL IO, and usleep of 167 ns for
the terminal IO.