Replace unclear "oops" and "can't happen" with LogicExceptions

Unfortunately the methods ApiBase::die...() hide the exceptions that
are actually thrown. PhpStorm and other tools don't understand this
and show an error. That's why some kind of return or throw is needed
even if we are sure the line will never be executed.

Exceptions with "oops" or "can't happen" messages already caused
confusion in other patches.

Change-Id: Ie6acf74fdb63b701054fd300bfb3ff3e4afc08c1
Merge "Replace unclear "oops" and "can't happen" with LogicExceptions"