Initialize the global transaction to null at initialization.

Otherwise, we have an uninitialized pointer in case of error.
Also abort the opening transaction in case of error.

No need to reset the pointer on the stack at end of function.