Reset maxHandles after each test.
Added test to check that maxHandles is reduced once EMFILE is encountered.