Simplify attachment deletion so it all happens in one query

Also move makePlaceholders to SQLDatabaseUtils