BUILD: activity: use #ifdef not #if on USE_MEMORY_PROFILING

This avoids most build warnings with -Wundef, and all other USE_* flags
are tested this way, let's do it there as well. See gh issue #1369.
1 file changed