Improve error handling on getsockopt when a level other than SOL_SOCKET or an optname other than SO_ERROR is supplied as per the conversation with juj