Sync output directories before bundling.

Ensure that the file metadata is recorded in the output directories before
we zip (or exit).

Change-Id: I25da59fbbda2148013e77c50ab64f0afcb13d020