Tests of CPT symmetry in B0-B0bar mixing and in B0 to c cbar K0 decays