Fixing flakiness in libfs_avb_internal_test

Using multiple unique_fd() and also modifying the file might
cause some races. Closing the fd when it's not needed.

Bug: 187303962
Test: atest --host libfs_avb_internal_test -- --test-arg \
      com.android.tradefed.testtype.HostGTest:native-test-timeout:5m
Change-Id: I789f33b49e7cbdb22396e1df9a2694dce9f8a6f7
1 file changed