fixed transaction memorization, which was slow and broken

- fixed NPE on transaction memorization when handle is null
- fixed performance problem with transaction memorization caused by handle recreation always wrapping proxied connection in a new proxy