set_resource_limits
This avoids an "Invalid argument (errno=22)" error on systems with lower hard limits.