Move and clarify ulimit check

Partial fix for issue #278