Don't always just exit on error

Beyond the creation of the lemem cgroup directory, if we hit a
subsequent error in any of the syscalls be sure to remove the
created cgroup directory before exiting.

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>
Re-work syscall error checking

Instead of

    ret = syscall(...)
    if (ret == ...)
        ...

do

    err = syscall(...)
    if (err)
        ...

The general rule of thumb for syscalls is to return 0 on success and -1
on failure. In C, 0 evalutes to false with anything else to true.

Signed-off-by: Andrew Clayton <andrew@digital-domain.net>