MIG: Automatic Data Selection for Instruction Tuning by Maximizing Information Gain in Semantic Space