Moved workaround for MinGW's missing %m support to a central place.