Now hexchat doesn't abnormally terminal when started as root.

This fixes #589/#504.
Factored locale related code in main() to a new function.
Removed unnecessary call to check_prefs_dir() in load_config().
This function is called in save_config(), where it is actually needed.
Forget to put an empty line after a function definition
Restructured a fair bit of cfgfiles.c. Besides making the code cleaner this allows
for better error handling (in fact the error message of check_prefs_dir () whould
make hexchat abort).
Spell check dictionaries were not being updated when changed.
Fixed mistake in last commit.
Merge pull request #621 from orium/dictionaries-update-fix

Spell check dictionaries were not being updated when changed
Fixed null pointer deref when we try to autojoin a channel of a network not
in the network list.
Followed richtroye suggestion and implemented the net == NULL guard in
servlist_favchan_find().
Restored inbound.c to make the pull request cleaner.
Merge pull request #622 from orium/null-ptr-favchan-fix

Fixed null pointer deref when we try to autojoin a channel
Merge pull request #590 from orium/run-as-root-589-504

Now hexchat doesn't abnormally terminate when started as root.