Added function captiveportal_init_dn_rules to release all pipesno at start and a minor change.

This solution solves the problem of release the pipes numbers at the beginning of captive portal described in issue # 3062. please check this, thanks. And a minor fix.