Effect of Pyragas feedback on the dynamics of a Q-switched laser