Added checking if read FIFO is not empty during reading and if write FIFO is not full during writing. Signed-off-by: Marcin Mielczarczyk <marcin.mielczarczyk@tieto.com>