saveMap() incorrectly writes metadata entries in VALIDATION block

Description

Reported by Murty Maganti on mapserver-users:

When I call mapObj.save(), I see a new tag ‘VALIDATION’ in layer section
of map file. It just contains metadata of layer. There is no mention of
this item in the online documentation. What is this item ‘VALIDATION’?
Is it replacement of METADATA or METADATA will continue to be there.

It turns out that there is a typo in the writeWeb() and writeLayer() functions (mapfile.c) and as a result they write the metadata hashtable contents in the VALIDATION block.

Simple fix, but we need a ticket since that problem is present in both trunk and 5.4