Add flags to pkg_open to allow some optimizations.

Add generic flag param to pkg_open and pkg_open2 that makes it
possible to perform partial load of packages, for instance skip
some parts of parsing, such as mtree or files parsing.