Refactor: cts,python: Move the run_cmd method into the Test class.
This is almost identical between cts-exec and cts-fencing. The only
substantial differences can be handled by setting defaults elsewhere.
Thus, combine these into a single method in the base Test class.