LongAttn: Selecting Long-context Training Data via Token-level Attention