checkcommits: Refactor how commands are run.
checkcommits: Refactor how commands are run.

Add a runCommand() function to minimise duplication and ensure
all external commands use the same codepath.

Signed-off-by: James O. D. Hunt <348fbaadfbada55ea105602bf5609e23ac1c4898@intel.com>

GabyCT/tests,sboeuf/tests,chavafg/tests,chavafg/tests,bwarden/tests,clearcontainers/tests,sboeuf/tests,devimc/tests,bwarden/tests,MarioCarrilloA/tests,GabyCT/tests,clearcontainers/tests,devimc/tests,MarioCarrilloA/tests