Misc code cleanup.
Rewrote MiniMap threading to use the "worker object" pattern.

Instead of subclassing QThread, an object of class MiniMapRenderWorker is
created and moved onto a thread of class InterruptibleThread.  Also, instead
of stopping the render thread and updating the minimap's MapComposite in the
application thread every time a change to a map occurs, all changes to a map
are passed as objects of type MapChange to the worker object.

The size of the minimap is no longer tied to the sceneRect of the MapScene
for the map being edited; instead, it is as large as the minimap's MapComposite.
This was an issue before because the sceneRect could change due to layer and
lot visibility, resulting in the minimap not being the right size to display
the fully-visible MapComposite.

InterruptibleThread and BaseWorker were revamped which affected all the other
classes using these objects.
Made tileset reference-counting even faster.

The reference-counting code in TileLayer was moved to Layer so that ObjectGroup
could use it.  'Map' counts the number of layers using each tileset so getting
the list of used tilesets or checking if a tileset is used is very fast.
Fixed MapImageRenderWorker not freeing its image.
Levels view displays "<no level>" after a tile layer name without an "N_" prefix.
The bounds of a TileLayerItem did not include the draw margins of the layer.
Fixed regionAltered() region not being clipped to the tile layer's bounds.
Use SmoothTransformation for the MapsDock image thumbnail.
BuildingEd's object tools are much less fidgety now.

The cursor object used to disappear when the mouse pointer was in the center
of a tile or in a corner.  Now the cursor object is always displayed (unless
the coordinates are out-of-bounds) and objects are aligned based on the nearest
edge (or edges).

The furniture tool no longer requires the Shift key to choose between 2 different
orientations in corners, it works much the same as the other tools.
Replaced QRect::adjusted() with BuildingFloor::bounds(dw,dh).
Furniture in RoofCap/Frame/Door layers may be placed on the outer edge of a building.

Since furniture in these layers is intended to be on walls it makes sense
that furniture tiles in the E and S orientations be allowed on the outermost
edges of a building.
Fixed graphics corruption with building object cursor items.

Not sure why I didn't see this a while ago...
Fixed the building tiles dialog not updating itself properly when a tileset was removed.
BuildingEd remembers the previously-active tool when switching editing mode.
Fixed the minimap's handling of renaming layers.
Added some sanity-checks to the minimap's handling of regionAltered().

A prevous commit fixed the region not being clipped to the tile-layer's bounds,
but it doesn't hurt to make sure.
Fixed possible issue with calculating the minimap's bounds.