net: wifi: shell: use `getopt_state` for safer `optarg` access

Using `getopt_state` to access `optarg` and also `optopt` offers
a better alternative to direct global access.

See e145eb9201e for the previous change related to this.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
1 file changed