fixed memory leak in graph cut unit test

@tklein23
This PR is for fixing the [GraphCut_unittest memory leak issue](http://buildbot.shogun-toolbox.org/memcheck/20140625-2038.html)

Thanks @hushell for the discussion in IRC.