Only check for tcmalloc symbols when linking statically (#455)