Helper method performing a JNDI lookup for a given EJB class. This should be called on an annotated EJB to ensure
it's correctly injected. If the lookup fails, which is expected when deployed in the local SCP runtime, the given
EJB instance is returned, which should then represent a correctly injected EJB for the local deployment.
cls - The class of the EJB.
ejb - The instance of the EJB (can be null if EJB has not been injected via annotation).