Farah ends track career with win