kboot: Move termios to libkboot
Sponsored by: Netflix
(cherry picked from commit 36ef238cb604c827c696e975281f63d90641005f)