fix #432 wait to flush process output

see https://github.com/projectkudu/kudu/issues/432 for detail