This computes the correct LOCALBASE from the environment, or from the "user.localbase" sysctl, or from the default at build-time, in this
order.
This change is still incomplete and untested, intended for review on the approach before possible integration.
Sponsored by: The FreeBSD Foundation