I don't know if it will work on a sewing machine lightbulb but I have removed a broken bulb for a lamp with a peeling knife and pliers. First unplug from power, then slip the narrow knife tip in between the metal ring and the socket. Turn the knife a bit until you get a piece of the metal to bend in a little. This will allow you to grasp the metal rim with the needle nose pliers and carefully persuade the socket to turn out.