Fix running of API tests when BUILD_STATIC_BIN is enabled.