Link Python libraries for C++ tests.

Refs #7798
Merge branch 'feature/7798_tcmalloc_memory_reporting' into develop