ReleaseResourceAndFlush

Sends a message to the rendering thread to release a resource, and spins until the rendering thread has processed the message.