core/intcode: fix unsigned to signed conversion function