bhyve: Deduplicate some code in modify_bar_registration()
No functional change intended.
Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40877
(cherry picked from commit 0dea4f064dfcd0725d02b9b2d02b2494ca866857)