I think you just forgot that the $\int_A^B F\,dl$ is not a scalar expression. Rather it should be written in a form $\int_A^B \vec{F}\cdot d\vec{l}$. Then it comes to the sign of the scalar product:
$$\vec{F}\cdot d\vec{l}=F\,dl\,\cos\theta$$
where the angle $\theta$ is taken between the vector $\vec{F}$ and the direction of the tangent to the integration path from $A$ to $B$. Then, in your first example,
$W_{A \to B}=\int_{r_A}^{r_B} F(r) dr = \int_{r_A}^{r_B} \left(-\frac{GMm}{r^2} \right)dr$
the path could go with any slope, but the gravity is always directed downwards, along the $r$ axis. That means, we can always take $(\pi-\theta)$ as the angle between the vector $d\vec{l}$ and the $r$ axis, that is
$$dl\,\cos(\pi-\theta)=dr$$
but $\cos(\pi-\theta)=-\cos\theta$ and thus we have
$$\vec{F}\cdot d\vec{l}=-F\,dr=-\frac{GMm}{r^2}dr$$
For your second example:
...we also should change the sign, because the gravitational force is always a force of attraction.
what the authors actually mean is that: the Coulomb's and Newton's forces have exactly the same expressions, but the sign conventions for them are different. The Newton's force is defined that if all the quantities ($M$, $m$ and $r$) are positive, then the vector of the force is directed towards the other body. But for the Coulomb's force, if all the quantities ($q_1$, $q_2$ and $r$) are positive, then the vector of the force is directed away from the other charge. That becomes manifest if we take the vector expressions for these forces:
$$\vec{F}_N=-\frac{GMm\,\vec{r}}{r^3}\qquad\vec{F}_C=\frac{q_1q_2\,\vec{r}}{4\pi\epsilon_0\,r^3}$$
Now the different signs are clearly seen.
"...from point $A$ to point $B$..." - ...as I understand it - the work that I must do is always $U_B-U_A$. However the work that the force that is being created by the field do_es_ is always $U_A-U_B$, am I correct?
Yes this is correct.
The mnemonic rule is very simple: $U$ is like the height of the slope. When you go up, $U_B>U_A$, and it is you who does the work. But when you go down, $U_A>U_B$, and it is the field force who does the work.
$U$ is the electrostatic potential energy of the system of the three protons.
To assemble the three protons coming from infinity external work needs to be done so the electrostatic potential energy is positive.
So the textbook answer has computed the external work which needs to be done to bring the protons together.
Another approach is to compute the work done by the electric field which will be negative as you have found.
Best Answer
The work done that we consider here is the work done by external force (or by us).
So if the potential energy at a point is high then it means that the work done by us against the conservative field (say, gravity) will be also be high.
For example, if we lift a body, it's potential energy increases with the height because we are doing work against the conservative force (i.e, gravitational force) and this work (+ve work) gets stored in the body as its potential energy. In other words, higher we lift the body higher will be its potential energy.
Energy conservation plays a very important role here.
Now, if the body comes down the work done by gravity will be positive. The body's potential energy will be converted into kinetic energy. The body is coming from a point of high potential energy to a point of lower potential energy, so this loss will be the gain in the kinetic energy (or the work done by gravity).
Therefore, the work done by the conservative force (gravity) will be equal to the loss in potential energy.
Since the work done by gravity is $+ve$ and there is a loss in potential energy $(\Delta U=-ve)$,
$W_{conservative}=-\Delta U$