Free each function's ProfTransRec after optimizing it