Layer potentials for elastostatics and hydrostatics in curvilinear polygonal domains