Fix memory corruption on empty raster query (#4778)
Merge branch 'branch-6-2' into branch-6-4

Conflicts:
	maprasterquery.c
	msautotest