Search for CP violation in D0→π-π+π0 decays with the energy test