Debuggability improvements in gosxappinfo.m
See the commit messages. This basically adds some additional precondition checks which might help track #2119 (closed) down. There are a couple of other fixes thrown in (including a minor const-correctness API break which needs careful review) for problems I saw while editing the file.