Reduce UI freezes via conditional lock

A good deal of UI freezes when new blocks come in seems to be related to the UI thread waiting for the cs_main lock while the block is being processed.  The game map is updated every 250 ms by the UI, which causes the freezes.  This patch only updates the map in a particular timer tick when cs_main can be immediately locked and skips the update if not.  This reduces the freezes noticably for me, but it runs the risk of not updating the game map "immediately".  I believe this risk is minor, though, as a skipped update will simply be done 250 ms later as soon as the lock can be acquired.  Still, it would be good to do some testing with this patch.

It also includes my earlier pull request with the critical bug fix for RPC error crashes.