drivers/flash/flash_shell: Check for read error before verification
drivers/flash/flash_shell: Check for read error before verification

The cmd_write contains write verification that compares what has
been written with what it can read; the flash read operation
status was not checked which means that the bus or communication
problem was reported the same way as malformed write.
There have also been some optimization done by removal
of multiplications.

Signed-off-by: Dominik Ermel <1a1d45a9cc0c98a37f8d0a0d2dbe3cacc0b2344f@nordicsemi.no>

zephyrproject-rtos/zephyr,galak/zephyr,galak/zephyr,galak/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,finikorg/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,finikorg/zephyr