Added break to actually break out of the while loop when poll() succeeds. Changed the way the timeout is recalculated on EINTR errors. (#78)