Fix fd leak in gangliad (CID 10395). #3515