Check for proj4 in a way that also works in module environments
Merge pull request #2333 from ahocevar/better-proj4-check

Check for proj4 in a way that also works in module environments