consts: Fix another excessively strict expects_item
get_const_val needs to handle foreign static items
debug