replace subprocess.check_output with Popen magic

check_output isn't available in py 2.6...