Use AM_TESTS_ENVIRONMENT rather than TESTS_ENVIRONMENT because the
former is reserved for the user to set when running the tests; fix a
misnamed variable; add missing mkdir for .test generation rule because
it can’t be guaranteed that the builddir actually exists; and use TAP
for installed tests too.
However, the Type is retained as 'session-exclusive' due to the
presence of a graphical test.