[Application] Add the check for the return value.

This patch is to add the check for the return value of FromID() and
GetStoragePartition().

Related to XWALK-2928.
what if we keep the existing code, and just add "if (!rph) return.."?