fix getrlimit in SAFE_HEAP; fixes #3109