Due to a regression introduced in 3e32a9abe1 (Don't bother resetting
wxStaticBitmap image when destroying it, 2025-06-12), which was part
of #25518, the handle of wxBitmap passed to wxStaticBitmap::SetBitmap()
was destroyed when another bitmap was passed to SetBitmap() later.
Fix this by ensuring that we don't overwrite the value of the current
handle (to be deleted) prematurely in DoUpdateImage().
Add a simple unit test for wxStaticBitmap checking that the problem is
really fixed and, under MSW, also that it doesn't leak bitmap handles.
Closes#26106.