getsockopt: improve locking for SOL_SOCKET level socket options
Ensure SOLISTENING() is done inside SOCK_LOCK()/SOCK_UNLOCK()
for getsockopt() handling of SOL_SOCKET-level socket options.
Reviewed by: markj, rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D46881