First measurement of the electron neutrino charged current pion production cross section on carbon and optical calibration development for Hyper-Kamiokande