scripts: unit-test: Make valgrind exit failure on error

By default valgrind exits with the exit status of the process under
examination. From the manual[1]:

>  --error-exitcode=<number> [default: 0]
>
> Specifies an alternative exit code to return if Valgrind reported any
> errors in the run. When set to the default value (zero), the return
> value from Valgrind will always be the return value of the process
> being simulated. When set to a nonzero value, that value is returned
> instead, if Valgrind detects any errors. This is useful for using
> Valgrind as part of an automated test suite, since it makes it easy
> to detect test cases for which Valgrind has reported errors, just
> by inspecting return codes. When set to a nonzero value and Valgrind
> detects no error, the return value of Valgrind will be the return
> value of the program being simulated.

[1]: https://valgrind.org/docs/manual/manual-core.html#manual-core.options

The default value of 0 is not actually useful for CI, where we want it
to bubble up a failure if poor behavior is detected.

Change-Id: I6e7c56b9ccee5c8f9c5234df19ab84009868ff88
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
1 file changed