testsuite: Pass $srcdir and $builddir in the test environment

This fixes the testsuite when using Autotools.

This bug was hidden so far because I had an installed version of otis
and templates were taken from this copy, instead of the source
directory.
Fix bug in subst's template with user variables

The result of the regex substitution was thrown away instead of used to
update variable's value.

While here, add a testcase for this bug.