Prisoners' dilemma in the presence of collective dephasing