SD.begin(4) can only be called once. This is a bug in the SD.h wrapper for SdFat.
You should not need to call SD.begin() other than in setup unless you change SD cards.
You can fix SD.begin by editing SD.cpp in the libraries\SD folder of the Arduino IDE.
Add a root.close() statement to begin like this:
boolean SDClass::begin(uint8_t csPin) {
root.close();
/*
Performs the initialisation required by the sdfatlib library.
Return true if initialization succeeds, false otherwise.
*/
return card.init(SPI_HALF_SPEED, csPin) &&
volume.init(card) &&
root.openRoot(volume);
}