The initial goal of this commit was to make the in-mem content_add raise
errors on input that would make postgresql error.
As a side-effect, the pgsql content_add now validate its input as well,
so clients get a nice/meaningful error instead of postgresql's error.
I'm planning on adding similar validation to other *_add methods.
Depends on D1864 (same repo), and D1860, D1861, D1862, D1863 (swh-model)