config_file_helper: don't call Modules::find() for null module

Installer doesn't have Modules, so this should let us share the code a bit
more freely.

Might also avoid some unexpected results.
Unify the config_file_helpers in installer & main Bonfire

Installer's write_db_config() had an $apppath option, to allow targetting
the real bonfire directory.  Add the option to write_db_config() and
write_config() in main Bonfire, then I can copy its version of
config_file_helper.php back into the installer.

This replaces the installer's hack for write_config(), so change the
callsite in the installer as well.

There was one other fix from the installer's write_db_config(), which
can easily be seen in the diff around file_get_contents().
install: remove two uses of APPATH.'../bonfire'
install: support relocated webroot in writeable files check