Add a warning to @memoized when caching is impossible

The @memoized decorator cannot cache function calls that take unhashable
arguments. So far it just ignored them, and silently called the function
directly without any cache. This commit adds a warning in such case, so
that we can see where @memoized is not really doing anything.

I used Python's warning mechanism, because we can easily configure the
particular warning to become an exception or to be ignored entirely.

Change-Id: I4b581f504972ffac589fdb78bfb9fb194d2b4525
Merge "Add a warning to @memoized when caching is impossible"