I will write Nx for "It is necessary that x". In Meaning B your premises are N(p→q) and p, from which nothing can be derived (by modus ponens) without additional assumptions. A very commonly accepted axiom of modal logic is that necessity distributes over implication:
N(p→q)→(Np→Nq) (Distribution Axiom)
Assuming that, premise 1) does entail Np→Nq. But even with that to derive Nq we need Np as premise, not just p. In terms of your example, in the B meaning it is not enough to assume that God knows that you will eat lentils tonight, but that God knows that necessarily.
The necessity of the consequence vs necessity of the consequent distinction was used to argue that God's foreknowledge does not exclude free will, or at least that this argument fails to prove otherwise. This argument in the context of free will was discussed by St. Augustine (On Free Choice of the Will) and Boethius (The Consolation of Philosophy), in ambiguous language. The flaw was later pointed out by Aquinas and others, see SEP article on Omniscience:
"Subsequent philosophers, however, beginning at least as early as Aquinas, identified a flaw in the argument. According to Aquinas (Summa contra Gentiles, I, 67, 10), the first premiss is ambiguous between the “necessity of the consequence” and the “necessity of the consequent”... On the former interpretation [meaning B] the premiss is true, but under that interpretation the argument is invalid, that is, the conclusion does not follow. Interpreting the premiss in the second way [meaning A] results in an argument that is valid, but this premiss is false. Just because God knows a proposition, it does not follow that the proposition is a necessary truth; God knows contingent truths, as well. In either case, the argument fails."
Of course, the theological fatalism argument, as this is called, can be rephrased without involving necessity, so this distinction does not resolve the issue, see SEP's Foreknowledge and Free Will.