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.
https://lists.debian.org/debian-dpkg/2014/11/msg00024.html
https://lists.debian.org/debian-dpkg/2014/11/msg00027.html

I can stick them in the formula if it's useful.