Makes Pig thread safe

* User `ConcurrentHashMap` instead of `HashMap`
* Add `synchronized` to `addListener` and `removeListener` methods because they use a `HashSet` that is not thread safe.