FactorGraph_unittest memory leak fixed

@iglesias the bug in https://github.com/shogun-toolbox/shogun/issues/1298 is because I forgot to unref something in the unit tests. I hope no problem now.