Coherent spin dynamics of electrons and holes in semiconductor quantum wells and quantum dots under periodical optical excitation: resonant spin amplification versus spin mode-locking