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
Merge pull request #9500 from owncloud/fix9475

Avoid unnecessary writing to the DB when prefrences are not changed in fact