A consistent measure of the merger histories of massive galaxies using close-pair statistics - I. Major mergers at z < 3.5