Better error handling in directory creation.

If a directory is created externally _while_ this plugin is
attempting to create it, stat the directory again and see if
it matches what we expect.

This handles a race condition between two jobs creating the
same directory.