Add support for external picture buffer allocation
The first commits are cleaning and refactoring the code to make room for the new API.
The extra data (atomic ints) are now allocated by a local malloc() and free() with the picture buffer.
A default allocator is provided or used if the provided one is broken.
Fixes #54 (closed) Deprecates !154 (closed)