close jshint window when no errors reported

When a jshint window with previous errors is visible
and a subsequent jshint check returns no errors,
close the jshint window.
fix accidental global var definition