build_wrapper: Remove 'global' for some variables when no assignment is done

Marking a variable with 'global' is only needed when you want to modify
said variable.

Change-Id: Ie8c6b0162181559daee3fa3ab9d9479416c662dc
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>