Pickle and Unpickle theano functions

Added a test case to verify if pickle and unpickle a compiled theano function works.
Passed.

This is the follow up of gh-1945
Up to now, the graph comparison function needed to clone the graph before being called. I agree, changing that (making the clone in the comparison only when needed) and move those special case to to the graph comparison is cleaner.