Backport 70f413982

This is a backport of a feature fixed in CMSSW_7_0_X in commit 70f413982 but adjusted to pre C++11 (patch used auto keyword).
This patch fixes the creation of the database object after the alignment when only large structure alignment is done but more than one IOV gets requested.