fixes for https://issues.apache.org/jira/browse/AMQ-3467 Clean up some code in MessageDatabase, add guards around logging to avoid big string ops when not needed.