py2.6: make our own check_output()

There's no subprocess.check_output in py2.6, so implement it ourselves.