Pass connection context to transaction execution

My approach on/Targets #563.
You should pass either `NULL` or a nil value here if `opt_ctx==NULL`.