Prevent underflow in heap size calculation
Prevent underflow in heap size calculation

If the free memory on a device is small enough then the calculation to
determine heap size could underflow to a large value. If this happens
then malloc will never return failure and instead will cause a crash on
allocation. This patch prevents the underflow so malloc works as
expected even with low amounts of free memory.

fahhem/mbed-os,YarivCol/mbed-os,cvtsi2sd/mbed-os,kl-cruz/mbed-os,c1728p9/mbed-os,Archcady/mbed-os,CalSol/mbed,bcostm/mbed-os,monkiineko/mbed-os,karsev/mbed-os,HeadsUpDisplayInc/mbed,YarivCol/mbed-os,karsev/mbed-os,ryankurte/mbed-os,andcor02/mbed-os,HeadsUpDisplayInc/mbed,mbedmicro/mbed,catiedev/mbed-os,kl-cruz/mbed-os,cvtsi2sd/mbed-os,netzimme/mbed-os,kl-cruz/mbed-os,HeadsUpDisplayInc/mbed,nRFMesh/mbed-os,infinnovation/mbed-os,ryankurte/mbed-os,kl-cruz/mbed-os,c1728p9/mbed-os,pradeep-gr/mbed-os5-onsemi,andcor02/mbed-os,HeadsUpDisplayInc/mbed,karsev/mbed-os,ryankurte/mbed-os,catiedev/mbed-os,kjbracey-arm/mbed,nvlsianpu/mbed,CalSol/mbed,RonEld/mbed,pradeep-gr/mbed-os5-onsemi,nvlsianpu/mbed,mazimkhan/mbed-os,mikaleppanen/mbed-os,fanghuaqi/mbed,bcostm/mbed-os,NXPmicro/mbed,screamerbg/mbed,cvtsi2sd/mbed-os,CalSol/mbed,andcor02/mbed-os,nRFMesh/mbed-os,kl-cruz/mbed-os,c1728p9/mbed-os,mikaleppanen/mbed-os,mazimkhan/mbed-os,catiedev/mbed-os,nvlsianpu/mbed,nvlsianpu/mbed,YarivCol/mbed-os,infinnovation/mbed-os,svogl/mbed-os,kjbracey-arm/mbed,arostm/mbed-os,betzw/mbed-os,mazimkhan/mbed-os,adamgreen/mbed,pradeep-gr/mbed-os5-onsemi,andcor02/mbed-os,RonEld/mbed,fanghuaqi/mbed,HeadsUpDisplayInc/mbed,svogl/mbed-os,nRFMesh/mbed-os,betzw/mbed-os,arostm/mbed-os,Archcady/mbed-os,netzimme/mbed-os,mikaleppanen/mbed-os,karsev/mbed-os,infinnovation/mbed-os,arostm/mbed-os,betzw/mbed-os,monkiineko/mbed-os,infinnovation/mbed-os,NXPmicro/mbed,karsev/mbed-os,bcostm/mbed-os,nRFMesh/mbed-os,svogl/mbed-os,NXPmicro/mbed,screamerbg/mbed,bulislaw/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,andcor02/mbed-os,Archcady/mbed-os,arostm/mbed-os,bcostm/mbed-os,mmorenobarm/mbed-os,betzw/mbed-os,cvtsi2sd/mbed-os,YarivCol/mbed-os,arostm/mbed-os,adamgreen/mbed,screamerbg/mbed,bcostm/mbed-os,catiedev/mbed-os,netzimme/mbed-os,bulislaw/mbed-os,ryankurte/mbed-os,mbedmicro/mbed,NXPmicro/mbed,pradeep-gr/mbed-os5-onsemi,catiedev/mbed-os,mbedmicro/mbed,karsev/mbed-os,mikaleppanen/mbed-os,mazimkhan/mbed-os,svogl/mbed-os,mmorenobarm/mbed-os,YarivCol/mbed-os,fahhem/mbed-os,fanghuaqi/mbed,mazimkhan/mbed-os,fahhem/mbed-os,infinnovation/mbed-os,fahhem/mbed-os,nRFMesh/mbed-os,bulislaw/mbed-os,mbedmicro/mbed,betzw/mbed-os,NXPmicro/mbed,nRFMesh/mbed-os,fanghuaqi/mbed,kl-cruz/mbed-os,Archcady/mbed-os,screamerbg/mbed,RonEld/mbed,RonEld/mbed,bulislaw/mbed-os,mikaleppanen/mbed-os,bcostm/mbed-os,CalSol/mbed,monkiineko/mbed-os,adamgreen/mbed,fanghuaqi/mbed,andcor02/mbed-os,pradeep-gr/mbed-os5-onsemi,NXPmicro/mbed,Archcady/mbed-os,mazimkhan/mbed-os,kjbracey-arm/mbed,adamgreen/mbed,mmorenobarm/mbed-os,svogl/mbed-os,fahhem/mbed-os,fahhem/mbed-os,mikaleppanen/mbed-os,svogl/mbed-os,catiedev/mbed-os,CalSol/mbed,mmorenobarm/mbed-os,cvtsi2sd/mbed-os,netzimme/mbed-os,betzw/mbed-os,c1728p9/mbed-os,YarivCol/mbed-os,ryankurte/mbed-os,monkiineko/mbed-os,c1728p9/mbed-os,Archcady/mbed-os,nvlsianpu/mbed,netzimme/mbed-os,nvlsianpu/mbed,ryankurte/mbed-os,monkiineko/mbed-os,screamerbg/mbed,RonEld/mbed,cvtsi2sd/mbed-os,CalSol/mbed,mmorenobarm/mbed-os,adamgreen/mbed,bulislaw/mbed-os,RonEld/mbed,bulislaw/mbed-os,arostm/mbed-os,screamerbg/mbed,HeadsUpDisplayInc/mbed,infinnovation/mbed-os,pradeep-gr/mbed-os5-onsemi,monkiineko/mbed-os,mmorenobarm/mbed-os,adamgreen/mbed,netzimme/mbed-os,c1728p9/mbed-os