Added exception catching to close port on error or keyboard interrupt