dpkg: Fix --root by properly stripping root from maintainer script path
The cmd->filename variable was getting the full path to the maintainer
script inside the chroot, and once dpkg had changed root, the path was
not valid anymore.
Regression introduced in 5050748f1a6bb0c0728f8c07f9058d545c80d7e0.
Closes: #580984