Profile,test: fix busy-wait test (#32933)
When d7a90c0bbfa228e920d509f2639c364feade84d3 was added,
it potentially reduced the sleep timeout to zero
if we took a snapshot right away, unintentionally
ensuring we did not have any samples inside Julia!
fix #29880 and add a test for the empty printing case