selftest: Add a variable to indicate that selftest is running