add a RAII class that tries to acquire the SolarMutex and releases it

Motivated by ScCompiler::IsMacro() which has an error return that does
not release the SolarMutex.

Change-Id: I064219bb3c0d68839a133101491d5f8828a26c7a
svx: convert some horrible code to SolarMutexTryAndBuyGuard

Try to preserve the existing spin-lock insanity as-is.

Change-Id: Ic98aa33d2e56536856892fcf61de672952101ae1