Fix menu save error in PostgresSQL

I ported the fix of Guillermo Vargas to Joomla Platform as it need to be in Joomla Platform first

Related tracker item:

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=29220