Resolving a discrete ambiguity in the CKM angle β through Bu,d→J/ψK∗ and Bs→J/ψφ decays