add synchronized blocks to more keystore methods
- context: upstream MR 14 introduces more methods for modifying the keystore that introduce more concurrent modification errors
- this MR marks those methods as
synchronized
(and in the case of methods that do lots of loop iterations, wraps the write calls in each loop in a synchronized block)