Add check so that FlashIAP does not allocate memory on flash_init failure.
Add check so that FlashIAP does not allocate memory on flash_init failure.

kjbracey-arm/mbed,kjbracey-arm/mbed,kjbracey-arm/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,kjbracey-arm/mbed,mbedmicro/mbed