check loginCallbackId exists before pluginResult call

We make sure that loginCallbackId exists before calling it. When it's not set, it triggers the exception referenced in issue #507