Add get_ref to result and adjust unit tests

I found that when processing large result sets that a lot of time was being spent creating new strings so I added a get_ref function which will fill in the reference with the column value instead of returning it.

While adding unit tests for these changes I ran into a few problems with the existing tests.  I'm not sure how the tests were previously passing so if you think this could somehow be related to something in my environment please let me know.  After these changes I was able to successfully run the sqlite tests on linux and windows.