Encapsulate all jthread_map calls inside critical section

Every single thread has to remember that an exception was already
reported in order to prevent multiple reports for a single exception.
The reported exceptions are stored in a list and each thread has own
list of reported exceptions. These lists are stored in a global map.

Refrences: commit 4144d9dade18645642f4360a9a4cd2fd318b4de4, issue #11

ThreadStart, ThreadEnd and Exception callbacks are called from different
threads but all of the access the thread to reported exception map.
Therefore access to internal data must be serialized through
lock-protected critical section.

Related to rhbz#1026208
Merge pull request #23 from jfilak/rhbz1026208

Fix a race condition in Java Thread callbacks