Add more information for failed db query

In case we can't add a directory to the database this might have more
then one reason. It could be a duplicate or another transaction is
currently running.