Damage protection of power modules