v1: add conflict resolution logic to put()
v1: add conflict resolution logic to put()

When creating a new folder or file in a directory, we may encounter
the situation where the new entity has the same name as another entity
of the opposite type in that directory.  Some providers allow this,
others do not, and others (Dropbox) behave weirdly.  We want to
provide consistent semantics for all providers.  When the provider
allows simultaneous names, each request should succeed with a 201
Created.  When they do not, the first request, regardless of kind,
should succeed, and the second should fail with a 409 Conflict.

Logic:

Note: this only applies to the case where the entity in the path
is a folder.  If it's a file, the collision isn't possible.

First we check if the target path already exists within the directory.
If so, we throw a 409, because we don't want to overwrite what's
already there.  If the user wants to update a file, they should do a
PUT against the file's endpoint, not the parent folder's.

If the target path does not exist, we check to see if the provider
allows files and folders with the same name to coexist.  If so,
there's no problem. If not, we check for the existance of an entity
with the same name of the opposite type.  If it exists, we throw a
409, otherwise proceed as usual.

One bit of weirdness is that Dropbox's exists() method returns [] if a
folder with the same name exists.  In this case, [] means True, but
python treats it as a falsey value.  To avoid this, we need to
explicitly test if the retval from exists() is a bool.

rdhyee/waterbutler,kwierman/waterbutler,RCOSDP/waterbutler,CenterForOpenScience/waterbutler,TomBaxter/waterbutler,Johnetordoff/waterbutler,felliott/waterbutler