serialposix: Fix inconstent state after exception in open()

If an exception occured during _update_dtr_state(), the Serial object
was left in an inconsistant state: is_open=True, but close() fails.
This patch fixes this by not setting is_open to True and by cleaning
up the state if an exception occurs during open()
1 file changed