next_pidmap: fix overflow condition