packet: Fix error path in packet_init