HDF query with long literal string fails
#### Code Sample, a copy-pastable example if possible

``` python
c_ids = ['50ef419195e6e40eac000001', '50ef419195e6e40eac000002', '50ef419195e6e40eac000003']

df = pd.DataFrame({'class_id':c_ids, 'a':range(3)})

df.to_hdf('teststore.hdf', 'df',format='t', data_columns=True)

print('with variable')
c_id = '50ef419195e6e40eac000001'
print(pd.read_hdf('teststore.hdf', 'df', where='class_id=c_id'), '\n')

print('with literal string')
print(pd.read_hdf('teststore.hdf', 'df', where='class_id=50ef419195e6e40eac000001'))
```
#### Actual output

``` bash
with variable
   a                  class_id
0  0  50ef419195e6e40eac000001 

with literal string
  File "<unknown>", line 1
    class_id ==50 ef419195e6e40eac000001
                                       ^
SyntaxError: invalid syntax
```
#### Expected Output

``` bash
with variable
   a                  class_id
0  0  50ef419195e6e40eac000001 

with literal string
   a                  class_id
0  0  50ef419195e6e40eac000001 
```
#### my own analysis

I figured it must have something to do with the length of the query, so I went down in class_id size to 14 characters, which is when it starts to work again:

``` python
c_ids = ['e6e40eac000001', 'e6e40eac000002', 'e6e40eac000003']

df = pd.DataFrame({'class_id':c_ids, 'a':range(3)})

df.to_hdf('teststore.hdf', 'df',format='t', data_columns=True)

print('with variable')
c_id = 'e6e40eac000001'
print(pd.read_hdf('teststore.hdf', 'df', where='class_id=c_id'), '\n')

print('with literal string')
print(pd.read_hdf('teststore.hdf', 'df', where='class_id=e6e40eac000001'))
```
#### output of `pd.show_versions()`
## INSTALLED VERSIONS

commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 14.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.18.0
nose: None
pip: 8.1.1
setuptools: 20.7.0
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.0
statsmodels: None
xarray: 0.7.1
IPython: 4.2.0
sphinx: 1.4.1
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.5.2
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
