Perfect duality for convexlike programs