Fix attachment directory path
Fix attachment directory path

* When options.directory is nil, the default directory should be used.
* Clean up code

#1583

couchbase/couchbase-lite-ios,couchbase/couchbase-lite-ios,amco/couchbase-lite-ios,amco/couchbase-lite-ios,couchbase/couchbase-lite-ios,amco/couchbase-lite-ios,couchbase/couchbase-lite-ios,amco/couchbase-lite-ios,couchbase/couchbase-lite-ios,amco/couchbase-lite-ios,amco/couchbase-lite-ios,couchbase/couchbase-lite-ios,amco/couchbase-lite-ios