open() home directory instead of chdir()-ing it

With a file descriptor for the home directory, we can use calls like
openat, fexecve and fstatat to access files relative to the home
directory without race conditions, while keeping the working directory
for dumping cores and the terminal's child processes.

Signed-off-by: Morten Hustveit <mortehu@google.com>
Started port to OpenGL 3.0

I have a buggy Nvidia driver at work, so this is an attempt to work
around those bugs.

Signed-off-by: Morten Hustveit <mortehu@google.com>