Fix memory limit issue on some systems

Setting `memory.limit_in_bytes` may cause `memory.memsw.limit_in_bytes`
resetted on some systems. Fix it by setting `memory.memsw.limit_in_bytes`
after `memory.limit_in_bytes`.
Use config.memory_limit directly

Instead of reading from cgroup, use config struct directly. This
could avoid some potential issues when cgroup memory values got
changed at runtime.