Only set terminals with X sessions into raw mode. Fixes #317.