A root system criterion for fully commutative and short braid-avoiding elements in affine Weyl groups