IOT-1461 Fix double-close bugs
1. Fix two handle double-close bugs.
2. Add asserts to catch possible similar bugs.
3. Log WSAGetLastError in decimal, for easier match with the values
from MSDN docs.
Change-Id: I7f382344994c496c67e2e370d2241f080ce0e71c
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13665
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-by: David Antler <david.a.antler@intel.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>