Add support for sysv message queues.

Part 1 of #680.