Cosmological stability bound in massive gravity and bigravity