Bidirectional photocurrent in p–n heterojunction nanowires