Check arguments to DS2LOG.

We use __attribute__((__printf__())) for this. This commit also contains
a few fixes for errors that showed up when we started using this
attribute.