Use an auxiliary python program for the max open files test

This makes the test work on non-Linux platforms, like OS X or
the BSD family.