Removes duplicates from dumped translation messages

`array_merge_recursive` combines values of duplicate array keys into arrays (`array_merge_recursive(array('test' => 1), array('test' => 2))` becomes `array('test' => array(1, 2))` which causes duplicate translation messages. This fix is copied from the controller which fixes the same issue.