database: add support for only-when-modified trigger paths
When a path for a trigger is prefixed with +, the path will only be passed to the script when the directory was actually modified. This is primarily meaningful when a package that provides a trigger is reinstalled or updated; normally, this would result in all possible paths being passed, which makes it impossible to know whether the path was actually modified or not.