Add flock to config

This adds a file lock to the config in hope that this prevents race conditions as reported in https://github.com/owncloud/core/issues/11070

Testplan:

- [ ] Delete config.php and make it read-only => Error is thrown that it is not writeable
- [ ] Installation still works
- [ ] Changing config settings works (i.e. using the SMTP config switches in the administration menu)
- [ ] Your PC didn't blow up
- [ ] Installing the news app and the "Disable AppCode checker" app did not destroy your installation

@bantu Please review. Much appreciated, thanks!
@PVince81 Your feedback would also be very welcome!
You don't want to use the write mode here - this will truncate the file before it is locked, this might lead to another race condition.

```php
<?php
$filePointer = fopen('./test', 'w');
echo(file_get_contents('./test'));
flock($filePointer, LOCK_EX);
ftruncate ($filePointer, 0);
fwrite($filePointer, 'New Content1');
fflush($filePointer);
flock($filePointer, LOCK_UN);
fclose($filePointer);
```