- set REDIRECT by default for Tomato
- fix bad merge of redirect code
- break out of self-redirect check loop early when self-redirect found
- free memory allocated by asprintf() to avoid memory leak