Generation of density waves in dipolar quantum gases by time-periodic modulation of atomic interactions