Captain of diverted flight dies after heart attack