Rearrange opening of output and input files for error handling

If the file could not be opened, the process would log an error
to the log file but the GUI would report success. Rearrange the
process so that the GUI shows an error.

Change-Id: I96af0b934c8f6f463d56656647b16accd1d40654
Only split archives when split_archives is set

In some cases, statfs used on partitions like /system does not
report a size that would trigger a split archive, but using stat
on the individual files shows a larger size that statfs that
would trigger a split. This patch prevents us from trying to split
an archive unless we explicitly decided to split in advance.

Change-Id: I67f5cd343f12333e1189100cf0ec1c20c15b7cc2