revert for Thiago, shouldn't have changed anything excepted under contention where it would have added surely more locks ;) + fixing compilation error in ejbd module

git-svn-id: https://svn.apache.org/repos/asf/tomee/tomee/trunk@1595473 13f79535-47bb-0310-9956-ffa450edef68