dfc8d4762b
Add _history_lock to serialize history load→extend→write in transfers_end(), preventing lost-update races on transfers.json if a second writer is added later. Fix file handle leak in _transfers_history_load() with context manager.