Lionel Messi broke a 40-year-old record for the most goals in a calendar year with a brace in Barcelona's 2-1 win at Real Betis.