[compositor] Release SHM buffers as soon as we have a replacement.

We don't need the render thread or a GL context to release SHM buffers,
so release them as soon as we have a replacement. This gives a pretty
good performance boost for clients with only two SHM buffers.