Hardy's criterion of nonlocality for mixed states