fixes an error when using PHP5.4+

Changes in PHP 5.4 cause menu_link_save() to generate several thousand errors whenever it is called. This was already fixed in D8, so this is just a port of the change.
https://drupal.org/node/1338282