Move #4577 fixes out of libmapserver
Merge branch 'branch-6-2'