Move strbuf implementation to shared/

Just move the strbuf-like implementation to shared/. No renames were
made yet to avoid cluttering the diff. It will come in a separate patch.
shared: rename prefixes of strbuf functions

Use strbuf_ prefix instead of buf_.