Keep temporaries for reuse, cleanup before pull (fixes #849, fixes #841)