Added check to prevent multiple commit/rollback on a single transaction

Mohamad mehdi Kharatizadeh
2015-09-14T14:48:36+04:30

when not using CLS #4491.
Added rollback to prepareEnvironment to abort half-initialized
transactions that run into error, fixes connection pool exhaust bug #4491.