Guard cursor for journalctl command in packaging tests (#86820)
It is possible for the cursor from journalctl to be empty, perhaps if
the log is empty. This commit guards the getLogs command line to only
add the --after-cursor if a non empty cursor exists, otherwise
journalctl raises an error.