Millions of Britons taking common heartburn medications could be at risk of developing depression, experts have warned.