Role of the $\Lambda^+_c(2940)$ in the $\pi^- p \to D^- D^0 p$ reaction close to threshold