a safe 'read_int()' that won't store garbage behind the user's back