Fix the bug in flashing code

Previously to that commit the code responsible for flashing did not
take into account that the 0x200 offset is only applicable to the
first page. It would case to the code not to erase any page after the
0x08005000 in time and cause flashing to fail.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>