Upgrades, try to backup database every script run

We have a problem when user has failed upgrade
and during some time he can run the same upgrade
again, in this case user will have outdated db data

In the patch we create database dump with postfix
N in the name, where N is integer which is unique
for the directory and which we increment each
script run.

Don't fail upgrade script if it was not able
to make database dump and there is database
dump in the directory.

Also we keep only 3 latest dumps.

Change-Id: I9d7eab3a79690e4b4720bc7fc2548b83368e415a
Closes-bug: #1342112
Merge "Upgrades, try to backup database every script run"