Use static gmock/gtest libraries.

Refs #9352
Merge remote-tracking branch 'origin/bugfix/9352_segfault_on_shutdown' into develop