In python3, os.read() automatically retries after EINTR, which breaks
our ability to interrupt on SIGALRM.
Instead, throw an exception from the SIGALRM handler, which should work
on both python2 and python3.
This fixes a rare deadlock during parallel builds on python3.
"Applications relying on the fact that system calls are interrupted
with InterruptedError will hang. The authors of this PEP don't think
that such applications exist [...]"
Well, apparently they were mistaken :)