cogserver: fix crash on close.
cogserver: fix crash on close.

Pursuant to discussion on mailing list.

gavrieltal/opencog,Allend575/opencog,rodsol/opencog,Allend575/opencog,rTreutlein/atomspace,rohit12/atomspace,jswiergo/atomspace,andre-senna/opencog,ceefour/opencog,roselleebarle04/opencog,williampma/atomspace,misgeatgit/opencog,williampma/opencog,Allend575/opencog,yantrabuddhi/opencog,sanuj/opencog,gavrieltal/opencog,misgeatgit/opencog,williampma/opencog,yantrabuddhi/atomspace,sanuj/opencog,ceefour/opencog,Allend575/opencog,printedheart/opencog,sumitsourabh/opencog,eddiemonroe/opencog,Tiggels/opencog,eddiemonroe/opencog,yantrabuddhi/opencog,inflector/opencog,zhaozengguang/opencog,cosmoharrigan/opencog,rohit12/opencog,prateeksaxena2809/opencog,kim135797531/opencog,AmeBel/atomspace,cosmoharrigan/opencog,eddiemonroe/atomspace,ArvinPan/opencog,roselleebarle04/opencog,yantrabuddhi/opencog,misgeatgit/opencog,kim135797531/opencog,jlegendary/opencog,ArvinPan/opencog,virneo/atomspace,AmeBel/opencog,yantrabuddhi/opencog,ArvinPan/atomspace,zhaozengguang/opencog,Selameab/atomspace,Selameab/atomspace,ruiting/opencog,kim135797531/opencog,virneo/opencog,ceefour/atomspace,andre-senna/opencog,cosmoharrigan/atomspace,cosmoharrigan/atomspace,iAMr00t/opencog,jlegendary/opencog,inflector/opencog,virneo/opencog,gavrieltal/opencog,ArvinPan/atomspace,eddiemonroe/opencog,rohit12/opencog,virneo/opencog,andre-senna/opencog,ruiting/opencog,rodsol/atomspace,kim135797531/opencog,rodsol/opencog,Selameab/opencog,sumitsourabh/opencog,iAMr00t/opencog,inflector/atomspace,AmeBel/opencog,jlegendary/opencog,ArvinPan/atomspace,rohit12/opencog,inflector/atomspace,AmeBel/opencog,roselleebarle04/opencog,printedheart/opencog,Tiggels/opencog,prateeksaxena2809/opencog,rohit12/opencog,rodsol/atomspace,kim135797531/opencog,ceefour/opencog,gavrieltal/opencog,TheNameIsNigel/opencog,Selameab/opencog,jlegendary/opencog,andre-senna/opencog,MarcosPividori/atomspace,anitzkin/opencog,printedheart/atomspace,printedheart/atomspace,eddiemonroe/opencog,cosmoharrigan/opencog,yantrabuddhi/opencog,shujingke/opencog,printedheart/opencog,tim777z/opencog,TheNameIsNigel/opencog,misgeatgit/opencog,anitzkin/opencog,williampma/opencog,jlegendary/opencog,yantrabuddhi/atomspace,yantrabuddhi/atomspace,misgeatgit/opencog,zhaozengguang/opencog,inflector/opencog,ruiting/opencog,TheNameIsNigel/opencog,prateeksaxena2809/opencog,ceefour/atomspace,UIKit0/atomspace,Tiggels/opencog,eddiemonroe/opencog,Tiggels/opencog,UIKit0/atomspace,ceefour/atomspace,misgeatgit/opencog,rodsol/opencog,inflector/atomspace,AmeBel/opencog,AmeBel/atomspace,sumitsourabh/opencog,UIKit0/atomspace,gaapt/opencog,shujingke/opencog,prateeksaxena2809/opencog,kim135797531/opencog,rohit12/atomspace,Allend575/opencog,roselleebarle04/opencog,gavrieltal/opencog,tim777z/opencog,inflector/atomspace,prateeksaxena2809/opencog,rodsol/atomspace,jswiergo/atomspace,Selameab/atomspace,AmeBel/atomspace,gaapt/opencog,ruiting/opencog,iAMr00t/opencog,inflector/opencog,williampma/opencog,virneo/opencog,MarcosPividori/atomspace,yantrabuddhi/atomspace,tim777z/opencog,eddiemonroe/opencog,Selameab/opencog,rodsol/opencog,jswiergo/atomspace,gaapt/opencog,cosmoharrigan/opencog,cosmoharrigan/opencog,yantrabuddhi/opencog,inflector/opencog,gavrieltal/opencog,sumitsourabh/opencog,MarcosPividori/atomspace,ceefour/atomspace,printedheart/atomspace,inflector/opencog,williampma/opencog,anitzkin/opencog,eddiemonroe/atomspace,jlegendary/opencog,rohit12/opencog,williampma/atomspace,ceefour/opencog,AmeBel/opencog,misgeatgit/atomspace,rodsol/atomspace,williampma/atomspace,misgeatgit/atomspace,andre-senna/opencog,rTreutlein/atomspace,sanuj/opencog,anitzkin/opencog,anitzkin/opencog,kinoc/opencog,printedheart/opencog,misgeatgit/atomspace,yantrabuddhi/atomspace,rTreutlein/atomspace,kinoc/opencog,inflector/opencog,sumitsourabh/opencog,roselleebarle04/opencog,rodsol/opencog,rTreutlein/atomspace,rodsol/opencog,ruiting/opencog,printedheart/opencog,cosmoharrigan/atomspace,eddiemonroe/atomspace,TheNameIsNigel/opencog,cosmoharrigan/atomspace,ArvinPan/opencog,sumitsourabh/opencog,shujingke/opencog,kinoc/opencog,roselleebarle04/opencog,AmeBel/opencog,kim135797531/opencog,sanuj/opencog,gaapt/opencog,rohit12/opencog,cosmoharrigan/opencog,Tiggels/opencog,virneo/opencog,williampma/atomspace,andre-senna/opencog,rTreutlein/atomspace,rohit12/atomspace,Tiggels/opencog,AmeBel/atomspace,Allend575/opencog,shujingke/opencog,ArvinPan/opencog,ruiting/opencog,UIKit0/atomspace,virneo/atomspace,ArvinPan/atomspace,Allend575/opencog,sumitsourabh/opencog,sanuj/opencog,misgeatgit/atomspace,ceefour/opencog,shujingke/opencog,iAMr00t/opencog,inflector/atomspace,gaapt/opencog,virneo/atomspace,ruiting/opencog,eddiemonroe/atomspace,kinoc/opencog,ArvinPan/opencog,TheNameIsNigel/opencog,misgeatgit/atomspace,virneo/opencog,prateeksaxena2809/opencog,williampma/opencog,kinoc/opencog,roselleebarle04/opencog,jlegendary/opencog,AmeBel/atomspace,inflector/opencog,Selameab/opencog,virneo/atomspace,gaapt/opencog,gaapt/opencog,kinoc/opencog,iAMr00t/opencog,tim777z/opencog,ceefour/opencog,Selameab/atomspace,zhaozengguang/opencog,zhaozengguang/opencog,zhaozengguang/opencog,MarcosPividori/atomspace,jswiergo/atomspace,misgeatgit/opencog,eddiemonroe/atomspace,rohit12/atomspace,Selameab/opencog,gavrieltal/opencog,AmeBel/opencog,sanuj/opencog,Selameab/opencog,yantrabuddhi/opencog,eddiemonroe/opencog,virneo/opencog,iAMr00t/opencog,printedheart/atomspace,anitzkin/opencog,andre-senna/opencog,ceefour/opencog,kinoc/opencog,misgeatgit/opencog,tim777z/opencog,misgeatgit/opencog,shujingke/opencog,prateeksaxena2809/opencog,anitzkin/opencog,tim777z/opencog,shujingke/opencog,printedheart/opencog,TheNameIsNigel/opencog,ArvinPan/opencog