Persistent charge and spin currents in a 1D ring with Rashba and Dresselhaus spin-orbit interactions by excitation with a terahertz pulse