Fix save_pretrained with offloading and weight conversions (#47018)