shape: Fixed buffer usage for Python 3.x

This is theoretically irrelevant since shapely is not yet compatible
with Python 3.x, but flake8 is complaining on Python 3.x that buffer is
not defined.