4304r if_exists == 'fail' should actually work

fixes #4110 #4304 

#4304 rebased and passes travis.

cc @y-p