Properly escape path in cygwin bash check

Quick attempt at properly fixing #3304
Merge pull request #3318 from ecoleman/patch-1

core: properly escape path in cygwin bash check