Fixed issue with $query object being overwritten by string.

This fixes this error:
```Fatal error: Call to a member function clear() on a non-object in /libraries/cms/installer/installer.php on line 1127```
This occurs when updating an extension.