Unset reference variable after looping by reference for administrator/components/com_[a-m]

- When looping by reference, reference variable is not unset at the end of the loop.
- and a bit CodeStyle

see: https://github.com/joomla/joomla-cms/issues/5482