Added variables DOING_UPGRADE, DOING_RECONFIGURE etc. in debian scripts

These variables can be used to selectively do things only on first
installation, during an upgrade etc. To make sure that everything works
as expected currently the values are logged to stderr (debconf can get
confused when using stdout).

Change-Id: I20400e9d57892db398e8ee531d9b05548932ce52
Fix ask_createdb debconf question being asked on upgrade

linotp/mysql/ask_createdb is a debconf question asked during
installation of the LinOTP debian package. Depending on the users answer
it will automatically create a MySQL database. Most users would probably
select 'Yes' (stored as 'true').

In LinOTP 2.5.X it was discovered this caused some problems because
since debconf stores 'true', in some cases it would try to re-create the
database on package upgrade.

The solution implemented in LinOTP 2.6 was to do a debconf RESET of
linotp/mysql/ask_createdb in the postinst script. The problem with RESET
is, it deletes all flags, including the 'seen' flag.

This means that from LinOTP 2.6 onwards when doing a manual package
upgrade the question "Do you want to create the LinOTP 2 database, now?"
is asked again (regardless of the fact that the databse already exists -
in most cases at least).

The first part of this fix is doing a debconf SET false instead of RESET
in the postinst script.

The second part is to set the 'seen' flag of the question to true when
detecting you are upgrading from a LinOTP version between 2.6
(inclusive) and 2.7.1.

refs #12298
closes #12718

Change-Id: I655983592437aa25e70b35b359fae1027898e673
Set some debconf questions to false in debian postinst

These values are only relevant during first installation and should not
be used during an upgrade.

A dpkg-reconfigure can be used to reset the debconf database and repeat
all questions.

Change-Id: I65f5c7e24bbfb94dd868c982a1785dafa474d8e9
Merge topic 'debconf' into branch-v2.7.1

* changes:
  Set some debconf questions to false in debian postinst
  Fix ask_createdb debconf question being asked on upgrade
  Added variables DOING_UPGRADE, DOING_RECONFIGURE etc. in debian scripts