Fix for double free in KdTreeFLANN after copy operation #335.

This is a fix for the bug #335.

I just replaced the regular pointer with a boost shared_ptr.