fixed memory leak in Statistics.log_det_test_3 unit-test

Changed the code that previously used SGSparseVector pointer. Made a few more changes.