Fixes a macOS Metal crash when stopping immediately after boot starts. m_upload_encoder and m_texture_upload_encoder could be dealloc'd during shutdown before endEncoding could be called, which causes a Metal assertion failure. Co-authored-by: OatmealDome <[email protected]>