Afghan opium cultivation has hit a record high as international forces prepare to leave the country.