Fixed a mapserver crash when using SQL item DB and an item's script is NULL

- Special thanks to Mumbles.

Signed-off-by: Haru <haru@dotalux.com>