uwb_core: polish BufferedFile::flush_buffer() method

This CL changes BufferedFile::flush_buffer() method to use
File::write_all() instead of write() method, then we could
make sure all the buffer is written. Also, the method should call
File::flush() after writing the buffer.

Bug: 256721796
Test: cargo test
Change-Id: I06b3eda073bf12bd2ababcffff6c9bdb6fd843d7
1 file changed