A study of CP violation in $B^{\pm} \to DK^{\pm}$ and $B^{\pm} \to D\pi^{\pm}$ decays with $D \to K_S^0K^{\pm}\pi^{\mp}$ final states