[imp] JArrayHelper::toObject allow non-recursive conversion

See the PR merged into the CMS at https://github.com/joomla/joomla-cms/pull/3836

//cc @phproberto