Real-time scheduling and memory locking is available on posix compliant OSs. This patch centralizes this functionality and brings support to FreeBSD, NetBSD, and Solaris. [ML: updated coding style]