G-DIG: Towards Gradient-based Diverse and High-quality Instruction Data Selection for Machine Translation