British American Tobacco writes down $31.5 billion as it shifts its business away from cigarettes