Do not version empty transactions.

An empty transaction will only be committed in the underline level but won't be versioned.

This feature is mainly to avoid allocating the next identifier (for nothing)
when incremental type identifier is used.

This commit also verifies that the next commit version is not null, if it is null a transaction
rollback occurs.