When stopping logging, write anything left in the SD buffer to the card