Fix variable definition in wrong scope

File "/usr/lib/python2.7/dist-packages/salt/states/pkg.py", line 702
UnboundLocalError: local variable 'modified_hold' referenced before assignment
Merge pull request #12004 from ticosax/fix-variable-scope

Fix variable definition in wrong scope