Init rlimits and use when allocating files

Init rlimits properly.

Use hard limit when allocating a new files array. This implementation
can't currently increate the size of the file descriptor array
if hard limit is increased. So currently it's a feture and it's kind
of hard to refactor away.