Fixed app config to always check the DB and not trust the cache

Sometimes the cache already contains default values that don't exist yet
in the database. The setValue() method has been fixed to not trust these
values and do an update with fallback to insert.

To test this:
1. Run `delete from oc_appconfig where appid='core' and configkey='shareapi_enabled';`
2. Go to the admin page and try and disable the "Sharing API" (which defaults to enabled), refresh the page
3. Re-enable, refresh the page

Before the fix it won't stay disabled and the DB will remain untouched.
After the fix: DB insert at step 2, and DB update at step 3

Please review @bantu @icewind1991 @karlitschek @schiesbn