unittests: add and use _open_meson_log function
unittests: add and use _open_meson_log function

Factors out opening the meson log into its own function so that
it can be used in the places where with was done before.

Additionally instead of checking if the file exists before opening it,
try to open it and handle the exception when it is not found.

mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson