Fix uninitialized variable warning
Fix makeDir on unix
Fix test_control.cc API calls
Fix redefinition warning in socket.cc on Win32
Minor fixes/changes to unix/system.*
Implement more system functions for Win32 platforms
Fix wrong initialization order between HAL and Lua