server: fix deadlock in load_models() when erasing a finished download (#25358)