Make optval pointer const in so_setsockopt() and cast away const-ness
internally.  This is consistent with how the userland setsockopt()
works.