MINOR: dynbuf: make b_alloc() always check if the buffer is allocated

Right now there is a discrepancy beteween b_alloc() and b_allow_margin():
the former forcefully overwrites the target pointer while the latter tests
it and returns it as-is if already allocated.

As a matter of fact, all callers of b_alloc() either preliminary test the
buffer, or assume it's already null.

Let's remove this pain and make the function test the buffer's allocation
before doing it again, and match call places' expectations.
diff --git a/doc/internals/buffer-api.txt b/doc/internals/buffer-api.txt
index d4e26db..a163e38 100644
--- a/doc/internals/buffer-api.txt
+++ b/doc/internals/buffer-api.txt
@@ -547,13 +547,12 @@
                     | ret: int         | and at least 3/4 of the buffer's space
                     |                  | are used. A waiting buffer will match.
 --------------------+------------------+---------------------------------------
-b_alloc             | buffer *buf      | allocates a buffer and assigns it to
-                    | ret: buffer *    | *buf. If no memory is available, (1)
+b_alloc             | buffer *buf      | ensures that <buf> is allocated or
+                    | ret: buffer *    | allocates a buffer and assigns it to
+                    |                  | *buf. If no memory is available, (1)
                     |                  | is assigned instead with a zero size.
-                    |                  | No control is made to check if *buf
-                    |                  | already pointed to another buffer. The
-                    |                  | allocated buffer is returned, or NULL
-                    |                  | in case no memory is available
+                    |                  | The allocated buffer is returned, or
+                    |                  | NULL in case no memory is available
 --------------------+------------------+---------------------------------------
 b_alloc_fast        | buffer *buf      | allocates a buffer and assigns it to
                     | ret: buffer *    | *buf. If no memory is available, (1)