sigpipe fix (for tcp mode)