Use a local to avoid calloc during format_packet in callbacks

Since we're calling `format_packet` from within signal handlers, I moved things around so it doesn't use an `*alloc`.