popen() and pclose() replacement in C