libc: Sync open_memstream(3) with FreeBSD. Also add open_wmemstream(3).Their open_memstream(3) implementation is more compliant than ours was.Taken-from: FreeBSD