use rlim_cur instead of rlim_max

(it seems rlim_max is unreliable on some systems and anyway
 as a userspace program, not trying to raise the limit, we should
 honor the soft limit and not the hard one)