move pkg_emit_manifest_file into public API and use it

Now pkg info -R directly output the manifest to stdout