Associate cached statements with correct logical connection

Fixes bug https://bugs.launchpad.net/bonecp/+bug/1247826
Merge pull request #19 from gbehrmann/fix/statement-caching

Associate cached statements with correct logical connection