Fix crash in AMI PJSIPShowEndpoint action.

If an AOR has no permanent contacts, then the
permanent_contacts container is never allocated.
This makes the code safe in the face of NULLs.

I also changed the variable that counts contacts
from "num" to "total_contacts" since there are now
two variables that are indicate numbers of things.



git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/12@407988 f38db490-d61c-443f-a65b-d21fe96a405b