spa: support: allow spa_log_xxx(NULL, ...) again with UBSan
Calling the spa_log_xxx macros with NULL log used to be allowed, and it's used in some tests.
Write the NULL check in a way the compiler can understand and make UBSan a happy UBSan.
Also deduplicate test-helper.h
in spa (which is where the issue was).
Edited by P V