Use a transaction when creating an artifact.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
Use the condensed form here:

```go
if err := tx.Commit(); err != nil {
    return err
}
```