Fix setupext [backport to 1.4.x]

Cleanup for build process on win32.  Detects `libpng` and `freetype` and raises an error if they are not found.  Also adds convenience method `get_include_dirs` to capture a pattern that was used  several times in `setupext.py`.

This addresses #3509.