The accretion histories of brightest cluster galaxies from their stellar population gradients