Added busy wait function to getInstance so that it always returns an instance in the running state or terminates on other invalid instance codes.
Merge pull request #11 from nwnoga/pa-instanceBusywait

Added busy wait function to getInstance so that it always returns an ins...