Improve error message for exports for OS2-only targets
Improve error message for exports for OS2-only targets

andcor02/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed,mbedmicro/mbed,andcor02/mbed-os,mbedmicro/mbed,mbedmicro/mbed,kjbracey-arm/mbed,andcor02/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,andcor02/mbed-os,kjbracey-arm/mbed,andcor02/mbed-os,mbedmicro/mbed