Britain transfers prisoners to Afghan custody to defuse a rights row