Merge pull request #23 from hurtonm/master

Don't assert on I/O error
Make socket functions EINTR safe