Link Python libraries for C++ tests.

Refs #7798