added missing synchronized blocks for avoiding concurrency issues

To make the Singleton instance completely thread-safe, please do the below 2 things:
1. mark the "registrationThread" static variable as "volatile" also
2. Add one more null check inside the synchronized block:
     synchronized (AgentRegistrationThread.class) {
          if(registrationThread == null) // double checking lock mechanism
             registrationThread = new AgentRegistrationThread(serverClient, registrationParams);