On Kakutani's dichotomy theorem for infinite products of not necessarily independent functions