Fix #8047

Ensure that json is returned when only updating the cache and in check mode
Merge pull request #8106 from muff1nman/pacman-update-checkmode-fix

Fix #8047