transaction: add NULL guards in API entry points
transaction: add NULL guards in API entry points

Closes: #1995
Approved by: alexlarsson

matthiasclasen/flatpak,matthiasclasen/flatpak,flatpak/flatpak,matthiasclasen/flatpak,matthiasclasen/flatpak,flatpak/flatpak,matthiasclasen/flatpak,flatpak/flatpak,flatpak/flatpak,flatpak/flatpak