Fix: check is_suid flag before each getenv()

Reported-by: Nick Mathewson <nickm@torproject.org>
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: use strtok_r reentrant instead of strtok

Signed-off-by: David Goulet <dgoulet@ev0ke.net>