Return correct error code from bind()

Closing the socket might overwrite errno so we need to save
its value.
1 file changed