Wrap fopen()/fopen_s() calls to avoid duplication