D0-hadron femtoscopy: Pion purity estimation