Fix incorrect buffer size calculation

This was discovered on OpenBSD which is far more aggressive about
using canaries and placing buffers at memory boundaries. In particular
this most often bites when a scalar is of length 0 because, unlike
Linux and MacOS X, OpenBSD does not return a memory pointer just
before a pre-zeroed section of accessible memory. Therefore any read
or write accesses to the returned pointer will typically result in a
segmenetation fault on that platform.
(cherry picked from commit 0099d3bccda8f386e96a5201a490a0f40062a608)
Update tests for OpenBSD

This will allow all acceptance tests on OpenBSD to pass except for
00_basics/03_bodies/118.cf which is due to a bug in OpenBSD's
implementation of grep. When OpenBSD's grep is corrected or replaced
with GNU grep, that test also passes.
(cherry picked from commit 4ac570a44c16852ff8cbf4dc89ff5fe1894641f9)