Fix compiler warnings resulting from invalid "errno" variable name

This fixes a couple of compiler warnings on MinGW.

The ISO C standard lists ```errno``` as a reserved word. It should not be used as a variable or parameter name by itself. On some platforms it is actually a macro, not a variable identifier, leading to rather confusing warning messages.