Time-projection chamber for the PEN experiment