Use shared_ptr to workaround compiler/stdlib bug

If _GLIBCXX_CONCEPT_CHECKS is defined, putting a unique_ptr into a
vector causes the compilation to fail, even though it's perfectly valid
and well defined to do so.
Using a shared_ptr is not perfectly right, but it workarounds the issue
without any runtime impact.