Fix a Reference/Memory Bug in TreeSortable

This commit ensures that a reference to the sort function remains in go,
so that the garbage collecter doesn't free the space.