Fix crash of gangliad on reconfig. #3515
Fix Coverity issues 10407 and 10408 in gangliad. #3515