boolean_pack() function
Pack a boolean value as an integer and return the number of bytes written. \todo Perhaps on some platforms *out = !!value would be a better impl, b/c that is idiomatic C++ in some STL implementations.
Return value
Number of bytes written to `out`.