Transaction compatible in try-with-resource

Have Transaction interface extends AutoCloseable which makes transactions
able to participate in try-with-resource blocks, like:

  try ( Transaction tx = db.beginTx() )
  {
    // db operations
    tx.success();
  }

finish() method has been deprecated but parts of the code still use it.
The focus has been here to convert src/main code, documenting tests and
any code ending up in the manual.
Merge pull request #1128 from tinwelint/2.0-try-with-tx

Transaction compatible in try-with-resource