Could you possibly be a
My solem wish is to break free,
A zipper usually holds together pieces of cloth.
If you double up, I shall not flee.
When both sides of the zip are connected, the zipper is intended to stay shut (even if I've had several zippers who didn't).
To the ground I tie you with my yarn,
There is plastic on one side (the connecting one) and yarn on the other side with is sewn.
in prisons the keep me, so I don't harm.
Zippers are usually protected by some fabric, or rather, protects the skin from the zipper.
Thick and thin and I come in various colours,
Well, zippers do.
sometimes I'm unseen in the summers.
Zippers are often put on jackets and other warm clothing.
Children fear me for my riddle,
Well, this is a bit of the stretch, but children usually fear the toothy side, which sort of makes a riddle...
usually I lay in the middle.
Zippers are usually put in the middle.