Millions of people worldwide take heartburn medications, often continuing them for years without stopping to ask whether the treatment is still necessary.