return shared_ptr in getter if member variable if shared_ptr

Status Job ID Name Coverage
  Test
canceled #8721
debian:10 clang-6-libcpp-17

canceled #8720
debian:10 gcc-8-17

canceled #8722
debian:9 gcc-6-14

canceled #8723
ubuntu:18.04 clang-6-17