The four-loop cusp anomalous dimension in N = 4 super Yang-Mills and analytic integration techniques for Wilson line integrals