hid/gtk: Focus file save dialog at exit to "Save", not "Close without saving".

Avoids inadvertently loosing work when closing the application. "Cancel" would
also be a safe choice of default focus, but the choice of "Save" is copied from
gedit to help give better platform consistency on Gnome systems.
png: add explicit round() calls to the scaling

After this commit the tests pass on both 32- and 64-bit builds.
Hopefully this time it's really dead; the previous "fix" af27c2d
by myself merely increased the DPI of the output, but this one
attempts to get deterministic rounding behaviour.

Tests from folks with actual 32-bit machines are welcome.

Closes-bug: lp-860037
polygon.c: Readability cleanup for frac_circle()
Fix some broken assumptions regarding 32-bit integer coordinates in polygon1.c
Currently PCB user can draw arcs at limited angles (usually 90 degree step), though there is no such internal limit for arcs angles.

Now the patched tool is expected to work like this:
1.point at the center,
2.the first point of arc
  (up to 270 degrees; sets the arc direction),
3.the second point of arc (the direction is the same as at the end
  of 2.; when the new arc overlaps the arc drawn in step 2., a full
  circle is created);
4.return to 3. until ESC (`F3' moves the starting point
  to end of the latest arc and returns to 3.)

During 3. and 4. Shift-click moves the center of the arc
to the pointer.

Switching from/to Line tool draws chained segments.

HOW TO TEST
Select Arc tool; draw different arcs with lines
pressing different buttons, and `F2', `F3' and `U' keys.

Signed-off-by: Bert Timmerman <bert.timmerman@xs4all.nl>

Modified-by: Peter Clifton <Peter.Clifton@clifton-electronics.co.uk>
     Updated to suit HID API changes
     Removed a couple of unused variables
     Squashed nasty trailing whitespace