On the Relation between Discounted and Average Optimal Value Functions