Fix a deadlock when loading assets