Compliance estimates for two-dimensional problems with Dirichlet region of prescribed length