fix windows build and successfully tested on windows with android NDK

with this patch windows works as expected. Fixed several problems:
1. rename file with opened file descriptor - failed
2. CreateProcess failed if path to executable with out ".exe"
3. fix get host name for win32