Review/hpux bug fixes

With these changes we should consider hpux a supported platform !

ps : The heap coruption issue was a pain in the neck, (wdb - gdb always pointed to the tottaly wrong address, and for the wrong reason !)