xenserver: Create xapi database cache in RPM preinstall step.
Until now, the RPM package for XenServer only attempted to save the xapi
database cache during the reboot process (from
/etc/init.d/management-interface), which happened well after the vswitch
was actually installed. This meant that if connectivity to xapi was busted
at reboot time, or even just if the machine was rebooted with the reset
button instead of through a graceful reboot sequence, then the machine
would fail to come up and there would be no way to fix it without removing
the vswitch.
This commit fixes the problem by writing out the xapi database cache before
package installation and aborting the install if the operation fails.