use stream_select() to get external tidy stdout/stderr

In the commit message accompanying 98c2703f81, I claimed that it was OK to read
tidy's output pipes serially (that is, first stdout, then stderr) because tidy
was guaranteed to write in the same order. This is apparently incorrect, as can
be gleaned from the large number of blocked tidy invocations on the job runners
(which are still on zend). So use stream_select() to read from stdout and
stderr as data is available.

Change-Id: I4909e5e20e6e1f46c598517c23657d1d0c4bc3e7