Fix the rebar wrapper on windows

System.find_executable for rebar returns a rebar.cmd file, which should not
be wrapped by escript. We now have an extra check that verifies whether the
invoked file is indeed a cmd file.
Merge pull request #1295 from ToJans/WindowsRebarFix

Fix the rebar wrapper on windows