Fixed issue with busy wait on closed remote socket