This may happes when taking too many photos in continuous mode or when the smartphone CPU is under heavy load (by another application).
This may be cause by saving the photos on the flash in another thread or "available memory" not being correctly detected.
As a possible solution I will switch back to save photos as soon they are received from the sensor.