replace_bind_variables will no longer replace ?'s inside quotes

replace_bind_variables, as written, naively replaces all ?'s, whether or
not they were part of a quoted SQL string or identifier, resulting in an
arity error when quoted ?'s are present.  This commit introduces proper
handling of ?'s within quotes, including handling of backslashed characters.

Code to reproduce the issue:

```ruby
class Foo < ActiveRecord::Base
  attr_accessible :bar, :baz
end

Foo.where(%q{ bar = ? AND baz = 'quux?' }, 'bindvar')
# without patch => ActiveRecord::PreparedStatementInvalid: wrong number of bind variables (1 for 2) in: bar = ? AND baz = 'quux?'
# with patch => #<ActiveRecord::Relation:0xd744>
```