STM32: Fixed I2C Bug reported in ARMmbed#14696
STM32: Fixed I2C Bug reported in ARMmbed#14696

Modified HAL_I2C_ErrorCallback function to solve bug reported in I2C Driver.
This commit solves compilation error occured when DEVICE_I2CSLAVE is not defined.

fix #14696

Signed-off-by: Affrin Pinhero <6fe933403e86d066e48dfd2d5ee140f71afeeee2@hcl.com>

mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed