Measurements of the branching fractions for D+→KS0KS0K+, KS0KS0π+ and D0→KS0KS0, KS0KS0KS0