Fix Mac build.

- Result of comparison against a string literal is unspecified (use strncmp instead).
- Explicit destructors.
- Invalid conversion NULL -> bool.
Merge pull request #1758 from darktears/mac-build

Fix Mac build.