I don't know if there is a way to prevent a skilled grappler from finding a way to roll out of anything!
Two things that can help:
1) give uke a concussion when you slam their head into the mat.
Not easy to do everytime, especially since new partners will become rare rather quickly, old partners will tend to run when they see you coming, and it can be difficult to get that level of control over strong, resisting partners who want to throw YOU on YOUR head.
2) When you pin, make use of the fourth control pressure point to get uke to keep their hips up off the mat. If their weight is limited to their head/shoulders and toes, it makes it hard for them to do much. But pain compliance is risky as a primary means of accomplishing pretty much anything. There are some structural componants to this type of control, but I'd feel silly trying to discuss it in an intelligent way.