Hold active tasks in a map, but cache finished tasks briefly

This should ensure that handles for active tasks will always be available, and for a while after completion, whilst preventing copytrans handles from accumulating in memory forever.