Fixed the race condition in the test. Reviewed-by: jjh
Add new methods in ManagementFactory class to obtain platform MXBeans Reviewed-by: alanb, dfuchs, emcmanus