Some fixes after Roma's review.

 + nonblock after accept
 + define SO_PROTOCOL, SO_TYPE constants for centos 5.0
ifdefs over all constants (for Centos 5.6 environment)
ifdef all errno constants (fix FreeBSD build error)
ifdef BSDsocket constants (to build with FreeBSD).
Merge branch 'stable'