tests: skip shared libs if default_library=static
Otherwise, the build will fail when the toolchain is static-only, even with -Ddefault_library=static. I talked to a Meson developer in their IRC channel, who told me that the correct fix was to ensure that shared_library is only used if default_library != static.