Make ``global-variable-not-assigned`` check local scope (#4990)

* Make ``global-variable-not-assigned`` check local scope
This checker now checks whether the names after the global keyword
are reassigned in the local scope.
This closes #1375

* Make ``global-variable-not-assigned`` check functions
This checker now also checks function defintions in the module and local scope
This closes #330

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
8 files changed