libc/string: add strdupa(3) and strndupa(3)
(cherry picked from commit a98e5d78500193dc7aa352e1f60ac2c6529e2c38)