Fix getcwd for Windows. Also, move getcwd out of the inner loop.
Fix getcwd for Windows.
Also, move getcwd out of the inner loop.

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb