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).
Fix an issue where the lag meter would be stuck after a reconnect caused by a
ping timeout.
Improve sort keybinding in servlist

also disable auto sorting on fav channels, closes #606
Python: Allow unhooking commands and prints by name
Merge pull request #603 from orium/lag-meter-stuck

Fix an issue where the lag meter could get stuck after reconnect
Passing a password to the /server command was ignored because the login method
was not set.
Merge pull request #618 from orium/server-command-password-fix

Fix issue with /server command
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.
Added PonyChat to network list