Add compiler switches for different locale setting variants
Remove dead setlocale code
Add memset to SharedBuffer