synchronize access to Database's changeListeners list

Iteration over the changeListeners in Database.notifyChange can throw a ConcurrentModificationException if addChangeListener or removeChangeListener is called from another thread. 

(We had some silly code that made this happen pretty frequently. I've fixed our code, but I figure this is a worthwhile change to submit anyway).

Full test suite passes on my end.