Make process output read subject to timeout.

The readlines itself should be very fast. Moving it inside the timeout
ensures that a zombie process, etc, doesn't cause it to hang
indefinitely.