Fix build when using clang and libunwind is installed

This fixes issue #5641