Make the code a bit more like the pre-API change code.

Change-Id: I9a8bd2c7ce97993c1b72caf63254d024950f8b94
Reviewed-on: https://code.wireshark.org/review/4520
Reviewed-by: Guy Harris <guy@alum.mit.edu>