You are not the first one on this forum to note problems with rtPrintf().
A better way to check if your any hit program is invoked could be to include a counter in your ray payload and increment it in the any hit program. You can then place the counter value into a buffer to return to the CPU at the end of ray traversal.