Bayern Munich midfielder Joshua Kimmich has signed a new four-year contract with the club after long-running talks.