The mentioned incident is one of the very few one that took place in case of the pilots. For that we cannot question the medical checkup facilities with which the pilots are entertained. Also there is hardly any long distance flight before which the pilots don't go through routine checkup. These routine checkups are enough to ensure that the plane is being handed to a healthily pilot. What we can do is to ensure that the medical staff of the plane remains more alert and conscious. Because in the mentioned incident, the passengers come to know the reality upon landing! If the planes' medical staff stay very much alert and take necessary steps in emergency situations like this, hopefully we will be able to get better results in the upcoming future. Still we must remember that we have no hands upon anyone's death. So whatever measure we take if death is destined of a person on a particular day, we cannot stop that to happen.
Also if any pilot doesn't feel fully sound with regards to health, he/she should report the authority immediately so that they exclude him from that particular flight. This will reduce the chances of unwanted occurrence and the passengers will have a better chance of enjoying a safe journey.