Detailed surface photometry of the cD galaxies NGC 4839 and NGC 4874