Merged MSYS compat changes from Obackup