TESTS: Fix trying to free a NULL task.