Dynamical solution to supersymmetric CP problem with vanishing B parameter