PERF: optimize memory usage for to_hdf
from [here](http://stackoverflow.com/questions/29016093/pandas-pytable-memory-overhead-when-writing-to-hdf/29035532#29035532)

reduce memeory usage necessary for using `to_hdf`
- was copying always in astyping
- was ravelling then reshaping
- was constantly allocating a new chunked buffer, now re-uses the same buffer

```
In [1]: df = pd.DataFrame(np.random.rand(1000000,500))
df.info()

In [2]: df.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 1000000 entries, 0 to 999999
Columns: 500 entries, 0 to 499
dtypes: float64(500)
memory usage: 3.7 GB
```

Previously

```
In [3]: %memit -r 1 df.to_hdf('test.h5','df',format='table',mode='w')
peak memory: 11029.49 MiB, increment: 7130.57 MiB
```

With PR

```
In [2]: memit -r 1 df.to_hdf('test.h5','df',format='table',mode='w')
peak memory: 4669.21 MiB, increment: 794.57 MiB
```
