Improve 265-color check for terminal.