Fix crash at reconfiguration time (Scenario & Console mode)

Recent LLVM versions intrdoced new Constant types, which can't be
casted to ConstantArray
(reconfig) Clean use before deleting ports
(reconfig) Fix global mapping setup