Make JMX registration optional

This patch is a modification of patch.txt, which is attached to ZOOKEEPER-1350, that can be applied to "trunk" branch.