[Part of patch #909005] Handle POLLPRI flag, and various errors cases.  Fixes bug #887279
[Part of patch #909005] Handle POLLPRI flag, and various errors cases.  Fixes bug #887279

sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator