Added checks for whether iCloud is connected before any operation in the iCloud file system.