Implement WaitForLogout in ThreadedSocketAcceptor

 in
Use linq instead of manual iteration
Merged WaitForLogout branch