packet-opensafety.c: Fix two bugs:

- Actually register dissector on default UDP ports upon startup.
- expert_...() shouldn't be called under 'if (tree)'

Also: cleanup proto_reg_handoff...() and apply_prefs() code.

Change-Id: I6390d9bf311c9a62fbc43647d9bb19f90156baec
Reviewed-on: https://code.wireshark.org/review/4063
Reviewed-by: Bill Meier <wmeier@newsguy.com>
(cherry picked from commit cc412a6cdf5321925ff0d35f0bcc28b42af69483)
Reviewed-on: https://code.wireshark.org/review/4064