Glad you updated your question to advise that you don't actually intend using a shock collar. However, given some people's blase attitude on this forum towards declawing and defanging cats, it's understandable that people were rightly concerned for Cozmo's welfare.
The technique of ignoring the meowing really is the best way of dealing with this behaviour. Usually it only takes a month or so for this method to work, but it sounds like Cozmo is finding the separation particularly distressing. I'm sure that there are lots of other changes taking place in your home and daily routine in readiness for the baby, and not all cats respond well to change. Perhaps he's finding the the changes a bit too much to cope with and simply wants the comfort of being near you at night.
Many cats are actually scared by the sound of babies crying, so you might find that once the baby arrives, that he loses any interest in sleeping in your bedroom. If you can find a recording of a baby crying, try playing it to see how he responds. If he runs a mile, then you could consider the option of allowing him to continue to sleep with you for now. If your main concern is that he might try to sleep with the baby, crib nets are effective protection against that happening.
If you're adamant that you don't want him sleeping in your room, then you'll either have to confine him to another room in the house at night or invest in an ultrasonic cat deterrent. The cat's movement triggers the sensor which then emit either an ultrasonic noise (inaudible to humans) or a burst of air to keep him away from the door.
http://www.deteracat.co.uk/indoor-cat-deterrent-sprayer.html
These leaflets have lots of useful advice on preparing cats for the arrival of a baby, which you may find helpful.
http://www.messybeast.com/cat_baby.htm
http://www.bluecross.org.uk/web/FILES/Literature/Your_cat_and_your_baby_leaflet.pdf