Measurement of cos(2beta) in B0 -> D(*)0 h0 decays with a time-dependent Dalitz plot analysis of D0 -> Ks pi+ pi-