Freebsd10 memlimit check and overlength-strings error workaround.

FYI this makes my codereview trigger finger itch. It's ok but it looks like something that isn't which increases code review cost.
const static variables:  ok
static non-const globals: haha not in my codebase ;)
non-static globals: you've got to be kidding me
#define ftw :)