Use BSD raw mode on darwin. Fixes nano, tmux and others

Fixes #3644