The deal will take Valeant into a growing, $5 billion annual market for drugs treating stomach disorders.