check the git exit script availability before using it in tests

this should fix failing tests such as http://www.cpantesters.org/cpan/report/11e1db4a-6c0f-1014-9e71-b4157edc59a7
tempfile() croaks on error, so catch the exception (and ignore it)

as it will be detected later on by the tests on
the newline needs to be quoted or it ends up in the .bat file verbatim
prevent the commandline args intended for the script to be passed to perl
the newline needs to be quoted or it ends up in the perl file verbatim