fix for: https://issues.apache.org/jira/browse/AMQ-4512 Usage and MemoryUsage sync fixes to keep state consistent during thread contention. Test case added.