Setting socket options: correctly handle NULL strings