Wait for the buffer to populate before reading the shell output

In some situations after the process finished running the Buffer thread didn't finish reading the output, and Buffer.getOutput wasn't returning everything.

You can try it with a command that returns a lot of lines (in my case a "tail -n 50" was already causing cut-offs)