Justin Allgaier overcomes early mistakes to win first NASCAR Xfinity Series championship