[distributed] Fix max_seqlen mismatch in ring attention backward (#18…