Lin’s condition for functions of random variables and moment determinacy of probability distributions