Optimize heat.Resource.get_by_node

Use memoization and a dict to cache the node-resource relation.
Also use LookupError instead of http.NotFound, so that we get proper
tracebacks.

Change-Id: Ic71c2fecaaca07ba070d896070efe8b094df8a78
Merge "Optimize heat.Resource.get_by_node"