Modified tile swapping to preswap dirty tiles, using a thread if
threads are enabled in configure or a gtk_timeout if they're not. The
code appears stable but could use improvement. Be careful when
working in here; there are four sets of semaphores and getting the
locking wrong will cause deadlocks or tile corruption. I'll try to
write up a document describing what's going on in here sometime soon.
--sg