The test_trylock reuses the cpu1_thread, but there is no way for it to
exit. This will cause the thread created twice, as a result, two cpu
running the same thread simultaneously cause an unexpected crash.
Fix this by adding initialization of resources and also the exit for the
cpu1_thread.
Signed-off-by: Jaxson Han <jaxson.han@arm.com>