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.
Any chance of trying to submit this upstream? I suspect it never was.