[init.sh] Use jboss-cli for server state check and shutdown

Proposing server shutdown solution, as discussed in email.