Query Reference should be stored at the driver instance

Bug::
#. Object reference pass as a parameter(Here $query) and then object is converted into string.
#. Assign string value on object variable (override $query variable. Its a wrong. Near the line number 700)
(Bug produced when use sqlite and invoke getTableList method)

First PR target to master branch https://github.com/joomla/joomla-cms/pull/1995
but on @Bakual request I have created new request for staging. :)  

I have already created ticket at Joomlacode tracker
 http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=33494 

You can test it with this plugin
https://github.com/mManishTrivedi/dbtester