To release the images, `ClearReleasingImages` basically takes all the `RefPtr<Image>` out of `mReleasingImagesOnMainThread` under a lock and then clears them, all on the main thread. This can be safely done before as late as XPCOMShutdownFinal on the main thread in order to avoid leaks.
Differential Revision: https://phabricator.services.mozilla.com/D160624