Fix Sorting Joomla! available languages issue

## PR summary
This PR fixes the issue #4907 reported by @brianteeman. Please see https://github.com/joomla/joomla-cms/issues/4907 for details description of the issue, he explained it very well.

## How to test:

1. Make sure your site has more than one language available.

2. Apply this PR

3. Login to back-end of your website, then go to Users -> Users Manager, click on an existing users to edit. Look at Basic Settings tab, there are two params "Backend language" and "Frontend language", please check and make sure the languages displayed in these languages dropdown are sorted by locale.