Changes to pkg related modules and pkg state

Ensuring that failed calls to packaging tools raise an exception, eg.  if the apt-get database is locked and salt tried to update the database.  @terminalmage  can you review this, make sure I didn't miss anything obvious.