don't trigger update from checkPassword, it is already called by userExists, this is enough.
do not write to database when the value is the same
add test cases. also split test classes in a file each, looks like only the first class is being executed
also appconfig shall not write to database if the value is unchanged
On SQLite the app order can be arbitrary and cause strange bugs.
On MySQL, the app order seems to be always alphabetical.
This fix enforces alphabetical order to make sure that all environments
behave the same and to reduce bugs related to app loading order.
Fixes#6442