Fix: fd leak on tor resolve error

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: return right value with localhost resolve

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