[#446] [#448] Makes plugin initialization more thread safe