Canelo Alvarez unified the WBA, WBC and IBF middleweight titles with a narrow points win over Daniel Jacobs.