Allow mode to be set for new log files

The default mode, 0600, is secure but not very useful for allowing multiple
users to read the logs.
Close old sessions when cleaning up

When cleaning up, we should close the socket after removing it from the various
structures, otherwise we're going to leak a filehandle every time a VM gets
moved between hosts.
Remove fd from the epoll stuff before closing

After we started closing old sockets, we were unable to add new sockets to the
epoller.  This is because we weren't removing anything from the epoller or our
poller structures, so if a repeat fileno came in we didn't do work to add it
but were surprised when it wasn't set up correctly.  To fix this, we actually
pull the socket out of the structures when we close it.
Merge remote-tracking branch 'bldewolf/master'