there's a product you can buy from one of those leaflet catalogues which comes with the sunday papers. it's a lump of shaped foam attached to a wide elastic strip which you wear on one leg and it's supposed to do exactly what you're needing. i can't comment on how good it is as i've never used one.
when i had my right hip done i followed the rules and slept (or rather didn't sleep) on my back for the required 6 weeks, had to resort to sleeping tablets from my gp in the end. also kept the TED stockings on for 6 weeks too, they're another nightmare. however, when i had my right hip done 10 months later, i took the stockings off as soon as i was home (4 days after op) and slept on my side with a pillow between my knees after a week. it's most unlikely the pillow will slip out of place enought to cause the hip to dislocate, and as long as you do a sort of eskimo roll to get on to your side you'll be fine.
any hip replacement patient will tell you the sleeping on the back thing is the absolute worst part of having a replacement. in the whole scheme of things, 6 weeks is actually not a long time and any discomfort is well worth it for the relief of leading an active life again. best of luck :)