Fix to unreported bug which printed result of getsockopt even in case when there was no socket error.