Add linux support for cgo package

Use fopencookie API from glibc instead of BSD's funopen API.