Really implement doc-promised upgrade if package(s) already installed

To accomplish this goal, we check that hashsum of full packagelist on
system has changed (covers both clean upgrade or dist-upgrade with new
package(s) installation) after apt invocation.

This is exact same implementation as in
https://github.com/ansible/ansible/pull/8530 for ansible-modules-core.