Added exception handling to safe_input to replace raw_input

Added exception handling for EOFError and KeyboardInterrupt