close the OS correctly. Refs #679