use of popen3 instead of popen to capture stderr