Merge "Convert ifstream usage into fopen() to prevent fd leaks into child processes"