Convert profile test to busywait to avoid Travis failures

May fix https://github.com/JuliaLang/julia/commit/fbd44636e4647014a588aef60a6b2cca7a2b990c#commitcomment-8088099. This passed both linux and osx. The old failure might have been intermittent, though, so it's hard to say. Still, seems worth merging.