Fix segfault in tests if the driver is not loaded

If the FF-A TEE driver is not loaded the setup phase of the tests will
fail as expected but then the teardown function tries to free
unallocated resources causing a segfault. This patch fixes teardown
functions by first checking if the resources were allocated before
freeing them up.

Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: Icacfdf7d8d3808503cb45a4a9233b7b2479f9aa2
16 files changed