Fix sleep logic in background gc thread example