Use srand/rand instead of initstate/random

initstate/random doesn't work on bionic, srand/rand works on everything,
so let's use that.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Define SOCK_CLOEXEC when missing

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Add missing sys/socket.h include

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Don't define new_personality when building without personalities

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Allow building without confstr

We use confstr to grab the default PATH value. If it's not there, just
use a standard one with bin and sbin for /, /usr and /usr/local.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Add missing namespace.h include

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Fix lxc-user-nic to work on bionic

This adds a couple of missing includes, uses the local version of
getline on bionic and replaces getpwuid_r by getpwuid.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>