Don't create several shared_ptr from the same raw pointer.

Otherwise they don't share the same ownership group and the object may
be deleted twice.