Fix copy_function for pypy

func.__code__, etc is available starting with CPython2.6, but it not on
pypy.