Re #7657. Reset the config to the default at the start.

Running the KernelTest executable directly showed that a previous test
had changed it so this test failed.
Re #7657. Correct indentation: tabs -> spaces.
Re #7657. Make tests pass when APITest executable is run directly.
Merge remote branch 'origin/feature/7657_jenkins_valgrind_job'