The implementation proposed in this PR is scary so I tried to solve this problem upstream in  [blosc](https://github.com/Blosc/python-blosc/pull/107) and [zlib](http://bugs.python.org/issue26379)  Hopefully we can swap to the more supported solutions when available and only use this hack when we need to. 