Fixed unsigned less than 0 error

new->fd is unsigned, while init socket returns <0 to indicate error.
changed code to return socket to signed var to allow for test, then
moved to new->fd