add generic apply_conf_ban function that takes a ban of any type (k/dline) and adds it, removing some duplicated code