Optional data for resource_data_get_all

resource_data_get_all queries the database for the data, and
transforms the results to a decrypted dict.

If the data is already loaded then it is unnecessary to do the
database query again.

This change allows data to be passed in as an optional argument.
If the passed data is not None then no database call will be made
and the dict transformation will occur on passed data.

Change-Id: I579225d9a3f3b038e0ca41a5900c58413d6e25ac
Related-Bug: #1306743
Merge "Optional data for resource_data_get_all"