Merge pull request #3653 from ntherning/alertable-socket-wait