TIMOB-14874-Check for close state before closing the socket again
TIMOB-14874-Make sure that listening thread check for socket to be valid
Merge pull request #5449 from salachi/TIMOB-14874

[TIMOB-14874] Check for closed state before closing the socket again