Make sure files are closed when no longer used.
Remove deprecated set_rules_hint calls.

Which haven't worked in ages with at least Adwaita anyway.
Get rid of deprecated reparent calls.