dpkg: do not always run dpkg_primary_arch

Having dpkg_primary_arch as a top-level statement means it will be
evaluated at startup, which will fail if dpkg is not installed.

Turn it into a function so it can be run just when needed.
tests: add a basic run test

Add a simple test which just runs the basic options of supermin, so it
can be tested even if the other tests (all being network tests) are
disabled.