dpkg 1.17.21

Version bump, rebased the patch against the latest release and externalizes it, adds some inreplaces discussed with upstream to fix compile issues, and adds a test.