* make tcprelay.py less nested
* import traceback module at the top
* make loops in DNSResolver less nested
* make manager.py less nested
* introduce exception_handle decorator
make try/except block more clean
* apply exception_handle decorator to tcprelay
* quote condition judgement
* pep8 fix
Previously we used logging.error(e) and traceback.print_exc()
to output error stack trace. The problem is, we want to
output the stack trace only when verbose > 0. The if statement
scattered around the code. So we replaced them with the new
utils.print_exception() call.
Although fd is always the smallest number which haven't been allocated, which means memory leak is quite small. but the worst situation may consume lots of memory.