Add secured fopen for windows support