unit-tests: Add a simple thread_cancel() test