close serial connection after write, reopen when needed