Mac: use lowercase hex letters in sha1 output.
Fix a possibly premature DeleteObject in draw.c.

This would be a bug if, for example, you set a bitmap as active while
another still-live bitmap was already selected in the hdc. In that case,
the old code deleted the previous bitmap, whereas the correct behavior
is to respect the user's ownership and let them delete it explicitly.