cherry-picked fix for #4528: support for running mapscript tests without having to instal…