avoid a segfault, if ulimit is set to unlimited

On some systems the admin has set no ulimit, this ends up in a segfault.

@ wferi & johntdyer: thanks