A few years back my machine kept sewing after taking my foot off the pedal. Someone told me it could be a fuse in the fuse-box on the house, can you believe that? Well a week later a fuse did blow, and after I had it replaced there was no more problem with the machine. It was a Brother embroidery machine, computerised, so maybe a bit touchy.
But I would still have your pedal checked