Recommit clearing of empty selections in GuiView

A similar fix was reverted (453ce611) because of crashes.
The crashes occurred simply because of a failed check that
we have a buffer view before using it. That is now done in
this commit.

The below commit description is copied from the original
commit (fb05011a):

Empty selections can cause confusing behavior for a few reasons:

(1) some functions behave differently depending on whether there is a
selection. If I press delete, nothing happens (where I expect the
character or inset before the cusor to be deleted). If I toggle bold or
emphasize nothing happens (where if there is no selection the entire
word is toggled). There are other LyX functions that depend on whether
there is a selection or not. Further, I wonder if any part of LyX's code
assumes that if there is a selection it is non-empty.

(2) menu options are incorrectly set. For example, the scissors icon.

For remaining empty selection issues, see #9222.

For more information, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg184758.html
Fix issue with CAS.

See http://thread.gmane.org/gmane.editors.lyx.devel/153516
This regression was due to a thinko in [43f6b167/lyxgit].
Fix font declarations.
Cmake build: 'callstack printing' detection.

Instead of depending on compiler we try to check for working
API as is done now for automake build too.
Fix CAS computation of a selected subformula.

Invoking a computer algebra system program for computing a selected
subformula has never worked (checked with all LyX versions back to 1.3)
and, moreover, in the presence of a selection things go awry.
This commit allows this computation by replacing the selected
subformula with the result of the computation.
po-files: remerge

- big update for pt.po
test-insets.lyx.lyx: forgot to commit this in r471889e0
Fix inset-select-all for insets with multiple paragraphs