[MERGE #3232 @xiaoyinl] Fix file handle leak in Helpers.cpp
[MERGE #3232 @xiaoyinl] Fix file handle leak in Helpers.cpp

Merge pull request #3232 from xiaoyinl:filehandleleak

We need to make sure `fclose(file)` is always called after the file has been successfully opened, so move it after `Error` label.

Another change is to move error message printing outside `#ifdef _WIN32`, so that it is printed on Linux.

Microsoft/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore