Fix memory leak in LinearMulticlassMachine issue #1629