Unix OSL: Update line-editing support.

Add additional error checking.
Take care not to reset attributes if they were never set.