On multi CPU systems, we may emit successive packets with the same id.
Fix the race by using an atomic operation.
Differential Revision: https://reviews.freebsd.org/D2141
Obtained from: emeric.poupon@stormshield.eu
MFC after: 1 week
Sponsored by: Stormshield