It is a bug in pykd. But your script will not work. It set breakpoint and then python interpreter goes out, python objects are destroyed.
You should change it:
pykd.go() # script will wait for target is break
You can upgrade pykd version to 0.3.0.7. It has additional argument for command !py:
!py -g script
This script will be run with "global" python enviroment - lifetime of global python objects is equal to lifetime of pykd module