Add bootloader flash protection

Add the code to write-protect flash corresponding to the code of
bootloaders before passing control to the user application or next
stage bootloader.

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