Fix const correctness of functions signatures.

Functions in the `common/errors` module returned `const char*` values
when asking for an error to print itself, even though these results were
duplicated versions of the internal strings.

That caused a bunch of
warnings while trying to free these results. `const` is now removed from
their signatures to avoid those warnings.