Fix a race condition when mounting loopback devices.

The previous code selected and configured the loopback device in two
separate stages.  This allowed for the possiblity that some other
code could claim the same loopback claimed by patch_kernel, leading
to failures.

BUG=chromium-os:24975
TEST=cros_generate_update_payload --output=<outfile> --image=<infile> --patch_kernel
TEST=image_to_live.sh

Change-Id: Ic081189f9431cb037a8b0eb02f0f9a19ad39d6d2
Reviewed-on: https://gerrit.chromium.org/gerrit/14716
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
1 file changed