Entangled states of dipolar bosons generated in a triple-well potential