Save char sex in db.
Add script function for change per character gender.

New script function: changecharsex
Merge pull request #419 from 4144/charsex

Add script command for change per char gender
Fix possible memory overflows and underflows.
Add some missing null pointer checks after automatic checks.
Remove useless checks.
fix typo in inter.c in initerface initialisation.
Fix wrong useless cycle added in commit c47d8e4b8f9d63ab6b4e7e286e91cd50a5bdd151.
Fix checking result from function TryEnterCriticalSection.
fix wrong check.
add comment about possible error.
Improve performance a bit by removing strlen(str) > 0.