On a functional equation related to an independence property for beta distributions