Fix #includes for Windows

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Move declaration of dlerror_value before it's used

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make console_opened/console_attached global variables

They are used elsewhere, too...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Use the original Windows mkdir() when defining fake_posix_mkdir()

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Override the #define'd is_slash with an inlined function on Windows

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>