libfec: Fix unaligned multiblock reads

fec_process miscalculates the number of blocks it needs to read when
we perform a small read that spans multiple blocks, which results in
a partial read. The function also returns early when it notices the
partial read without cleaning up the worker threads, which can lead to
the caller releasing the buffer that the threads are still using. Fix
the calculation and add a test case to fec_unittest.

Bug: 279705058
Test: fec_unittest
Change-Id: I0d36950d3324572043b345997a21bb3e985968e5
2 files changed