fsck_ufs: fix segfault with gjournal
The segfault was being hit in closedisk() while trying to free a
non-pointer.
The fix for this bug differs between stable/12 and stable/13.
PR:             245907
Submitted by:   longwitz@incore.de
Differential Revision:  https://reviews.freebsd.org/D30537
(cherry picked from commit 441e69e419effac0225a45f4cdb948280b8ce5ab)