Transport coefficients of the quark-gluon plasma at the critical point and across the first-order line