(#21427) Properly deal with facts again

The previous fix for #21472 broke the way that facts get sent in the body of a
post request. It also ended up removing the double unescaping because we
thought that it wasn't needed. It turns out that the double escaping is
critical because of the way that the agent sends the information. I wasn't
certain if it was safe the change that on the agent side, so I re-introduced
the escaping functionality on the master.