fix Issue 13385 - ICE with new package(names) protection
Merge pull request #3909 from 9rnsr/fix13385

Issue 13385 - ICE with new package(names) protection
[Refactoring] Tweak code style
[Refactoring] Slim up code logic
[Refactoring] protectionToChars(PROTKIND kind)
fix bug in protectionToBuffer()
Merge pull request #3906 from 9rnsr/refactor_protection

[Refactoring] around protection code fixed in the PR #3651