Denim giant Levi Strauss & Co will remain in its founding city of San Francisco until 2021, the company has confirmed.