Make sure non-APR_SUCCESS status is returned when nothing more read to avoid endless loop.