Properly check whether plugin loading is failed.
If plugin's library is missing a shared library, the factory might be
null but the load state is not reset to false. Also add another check
when using loadPlugin but without check the loading state.
REVIEW: 127685