Tests of CPT symmetry in B0-B0bar mixing and in B0 →ccbar K0 decays