Clean up resources while we still have a context