Avoid deadlock in subprocess by using communicate().

Reading subprocess stdout and stderr separately can
deadlock if either output exceeds the buffer size.
The reliable way to accomplish this is to use the
communicate() method, which reads both streams.