coverity 966576 - close socket in error path