Manchester United goalkeeper Sam Johnstone has signed a three-and-a-half-year contract extension with the club.