net/kni: fix crash caused by double stop
net/kni: fix crash caused by double stop

'close()' calls 'stop()' and 'stop()' cancels pthread without any check.
Calling 'stop()' & 'close()' sequentially tries to cancel pthread twice
which will cause a crash.

Adding a state check in 'stop()' before canceling the pthread to prevent
multiple stop.

Fixes: 696fbc7bb4fc ("net/kni: remove resources when port is closed")

Signed-off-by: Ferruh Yigit <ba8734c3c506d2e3557bd4ac8fdaccd25bdb9aa7@intel.com>
Tested-by: Yinan Wang <49b1c4c1483798ccfe23a5285410aaacc037c97a@intel.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk