Fix a race condition in the HistoryService

The check for existing history files was performed outside of the lock, so multiple threads attempted to create them and failed. This lead to missing entries in the logs.
Update libjitsi to baafc205d3aa1cef0b8583385308cd5547122f43
Close history documents after read
Add API to erase the call history
Remove most pre-sorting in the history service to avoid eliminations.

The sorting introduced in commit 4c665742027d7e89f0c136d1e30ea946be2a1c0f didn't take into account that TreeSet mandates that the ordering "...must be consistent with equals if it is to correctly implement the Set interface.". This was not the case as the comparator only checks for the timestamp of a history event and as such it can have two or more events at exactly the same time (and thus ordering) which would be overwritten in the resulting set.
Make the history "unit" tests a little more independent from each other