Prevent concurent access to terminal.