Make PDFDocBuilder return a std::unique_ptr

This make the memory ownership cleaner, and allows to simplify
a bit of error handling code in the `utils` directory.
7 jobs for pdfdoc-builder-return-unique-ptr in 5 minutes and 1 second (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #7277487
build

00:04:40

passed #7277492
build_android

00:01:02

passed #7277488
build_clang_libcpp

00:05:01

passed #7277491
build_clazy

00:03:39

passed #7277490
build_mingw64_fedora

00:02:48

passed #7277489
build_ubuntu_16_04

00:02:18

passed #7277486
clang_format

00:01:19