fix the bug of pointer may be NULL.
simplify the program logic.
add result detect for set nonblocking.
Merge branch 'master' of http://github.com/soarpenguin/tcpcopy
fixed coding style
fixed warnings