Switch from old Popen() to modern check_output()