Share code between debian/postrm purge and snap-mgmt.sh

The purge code in https://github.com/snapcore/snapd/blob/master/packaging/ubuntu-16.04/snapd.postrm#L13 and https://github.com/snapcore/snapd/blob/master/packaging/fedora/snap-mgmt.sh#L21 is very similar. We need to look into sharing code and/or generating the files from a common template.

@mvo thanks for bringing this up. @Conan_Kudo said recently he wanted to look into this last weekend. Not sure where he is with this. Idea was exactly to merge both an have a common thing we can invoke from all packaging bits and ship with the a snapd upstream release.

Re-tragging this into the backlog instead, as we don’t really have a clear view on when this will land at this point.