Handle flash full condition. Richer log status.

- Added flags/counter to monitor buffer overrun, log wraparound, etc.
Logging can be configured at compile time to wrap around or to stop
when flash is full.
- flash_log() checks for and logs buffer overflow
- moved block_current update logic from flash_log_block_write() to
flash_log_write()
- minor fixes