GFileChooser: fix various issues that could lead to a crash

r? @frank-trampe

cc #1640 (for the second checkbox, at least).
This could speed things up too since it stops allocating on every loop turn.