Issue 2169 a_theano_function.free() to free the temp memory

Initial the PR

1) check allow_gc, if False, loop over storage_map and set None

2) call free() in inner function