My understanding of the procedture in a hijacking for the pilots is as has been said, the cockpit crew should get out while the aircraft is being taken. However, after the case, the danger is it may unsettle the hijackers - who may take it out on the hostages, so crews should stay aboard, but try and stall any departure of the aircraft as much as possible.
My only knowledge is from a day I spent with a head of security planning who specialises in hijacks (so I'm NOT qualified to really comment).
In the case of Karachi, I understand the operation was run by Pakistan (it is their country and I somehow doubt they'd agree to US Commandos raiding the plane), with locally based US Security Officials observing, along with London based PA Security Officials. When you travel overseas you are subject to the laws and authorities of the land you're in and not your own. Welcome to the facts of life...
To those who say commandos could have been sent to Beirut to rescue everyone in some hypothetical school boy fantasy, I think you need to learn a bit more about the Beirut hostage situation in the 1980's (and what actually happened)
It was the interventialist policies of the US and other major powers that allowed terrorism like this to be fuelled and the ignorance of those who continue to proport it amazes me (it's a major reason why you see "white imperialist" type posts).
To all those who attack the crew for doing as trained: The first thing you learn for any job in the aviation business, especially any operational job, (the Goldern Rule if you like) is you always strictly stick to your training, especially when safety and security are concerned, failure to do so is likely to result in injury/death to yourself and or others. Anyone who cannot cope with that, has no place around aviation.