Make rotating log files robust against multiprocess access
Make rotating log files robust against multiprocess access

In the server at least and perhaps elsewhere as well, we have multiple
processes logging to the same rotating log file at the same time. The
standard Logbook RotatingLogFile handler does not handle this well.
Well, it doesn't really handle it at all.

This commit implements an alternative rotating log handler that uses
fcntl to lock the log file before writing to it or rotating it.

In addition to the fact that this new handler is robust against
multiple processes logging to the same file at the same time, there is
one other functional difference: this new handler will rotate the log
file when the log size is first equal to or exceeds the maximum file
size, not when it's _about to_ exceed it, so log files will be
slightly larger than the specified maximum size. This is done for
reasons of performance and code simplicity/elegance.

quantopian/PenguinDome,quantopian/PenguinDome