Change the compilers to alias -pthread to -lpthread.
Now threaded programs do not get linked to libc_r anymore, but to the
proxy lib libpthread. As soon as all programs and libraries are relinked
to use libpthread exclusively (and not libc_r.so anymore), threading libs
can be switched by changing the /usr/lib/libpthread.so.0 symlink.
Use the following command to find all packages still linking to libc_r:
find /usr/pkg/bin /usr/pkg/sbin /usr/pkg/lib /usr/pkg/libexec -type f \
-exec sh -c '\
objdump -p $0 2>/dev/null | grep -q "NEEDED.*libc_r\.so" || exit 0; \
pkg_info -F -e $0' {} \; | sort | uniq