#5 0x00007f7ffcdae2ac in __cxa_finalize () from /usr/lib/libc.so.12
#6 0x00007f7ffcdae19e in exit () from /usr/lib/libc.so.12
#7 0x00000000005c9ca5 in main ()
Which shows that it is referencing the in-tree libraries.

Is there something special I need to do to stop this from occuring?
Obviously (or not) symlinking to the correct library in /usr/pkg/lib
stops this problem from occuring.