Check for error on tx.Commit()

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>