Stop getting EMFILE errors by only opening as many processes as the operating system supports