Fix memory leaks, failure to restore umask and missing man page docs. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>