platform: msm_shared: Fix fifo overflow condition
platform: msm_shared: Fix fifo overflow condition

When multiple requests are sent to RPM the smd driver overwrites
beyond the limit of fifo size and causes the device to crash.
Before writing any request to the RPM fifo make sure to check
for overflow conditions and the wrap the read and write index
to the beginning of the FIFO.

Change-Id: Ie73f68ff4bdc1a957dbd19f076f9b6422485ecb7

efidroid/lk,efidroid/lk,CanarySolutions/little-kernel,efidroid/lk,Foxda-Tech/polaris-bootable-bootloader-lk,Foxda-Tech/polaris-bootable-bootloader-lk,CanarySolutions/little-kernel,efidroid/lk,CanarySolutions/little-kernel,CanarySolutions/little-kernel,Foxda-Tech/polaris-bootable-bootloader-lk,CanarySolutions/little-kernel,Foxda-Tech/polaris-bootable-bootloader-lk,Foxda-Tech/polaris-bootable-bootloader-lk,efidroid/lk