Quasi-two-body processes in π+-d inelastic reactions at 5.1 GeV/c