Handle non-initialised case, fix for is_writable always returning false on nonexistent file

Wondering if we shouldn't go further:
```php
if (is_readable($configdistfile) && is_dir(dirname($configfile)) && is_writable(dirname($configfile)))
```