Newcastle United have signed goalkeeper Loris Karius on a short-term contract until January with an option to extend until the end of the season.