TEHRAN, August 7 - Mattress Firm Inc, the largest U.S. mattress retailer, is considering a potential bankruptcy filing as it seeks ways to get out of costly store leases and shut some of its 3,000 locations that are losing money, people familiar with the matter said.