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.
use async.parallel to wait for the events
add local around the two block functions
Merge pull request #476 from racker/fixes/stdout_gate

fix(check): Custom plugins stdout