Fix flash queue bug

There were a few (mostly minor) issues when a flash_queue ran over a memory subsection boundary.  The following have all been fixed:

* If the subsection size is exactly divisible by the element size, don't skip writing the last entry of every subsection
* When using flash_queue_walker, take the subsection remainders into account so we read at the correct index.
* Don't over-estimate the count of the flash queue - subsections may have some unused remainder space, so just dividing the total size by the element size isn't enough.

Tested with the sensor and log queues.