fix(check): Custom plugins stdout

Stdout may have metric string buffered when we get the exit event. This patch
adds a flag to capture the stdout 'end' event. The process end event adds an
async whilst to wait for stdout to be closed.