fixed some multi-thread issues
Merge branch '1.4' of https://github.com/triAGENS/ArangoDB into 1.4