Electrical and optical properties of InP nanowire ensemble p+–i–n+ photodetectors