Wait for phantomjs output streams to end