cryptohome: Stop performing redundant IO in MigrateFile

- Stop calling GetLength().
- Stop calling Flush() and SetLength() for the last chunk.

With this change, migration completes about 10% faster.

BUG=chromium:713988
TEST=cros_workon_make cryptohome --test

Change-Id: I8fc8211fbb5d34552d506b7c33c5df63925653b5
Reviewed-on: https://chromium-review.googlesource.com/487842
Commit-Ready: Ryo Hashimoto <hashimoto@chromium.org>
Tested-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Dan Spaid <dspaid@chromium.org>
1 file changed