tests: Handle errors in subshels properly

Setting -e casused errors in subshels to kill them, but in many cases these
errors were not propagated to the main testing process. This commit sets up
a handler for errors encountered by bash which makes the test fail in such
cases.
tests: Add assertlocal assertions

This commit adds a new type of assertion: assertlocal_<condition>. This
is useful in subshells, when we want to kill the subshell without stopping
the whole test.
tests: Fix collecting errors in test_compilation_and_rsync

This test was suffering an issue with errors generated in subshells. In the
previous commit this kind of problems were fixed. This commits modifies this test
to rely on the mechanism of error propagation fom subshells and also adds some
useful error messages in case of a failure.
tests: Extend test_dbench to use goal 1 and 2

This commit extends test_dbench to test goal 2 as well as goal 1.