My 9-month-old did that for a while. What I eventually did was move him a little farther from me at night. He has urges to latch on just to feel me close to him sometimes, and I've noticed that he sleeps much better when we're farther apart. He's the one I could have put in a crib, probably. He still reaches out to make sure I'm there sometimes, but I've noticed that he now will only squirm when he truly wants/needs to nurse.