Added _set_valid_permissions().

gid is now set globaly in settings.

Added "locking" mechanism configuration variables.

PROFPD_LOG_FILE -> PROFTPD_LOG_FILE fix.