Fix race condition in InteractiveHostMP. Other fixs

There was a race condition in InteractiveHostMP (maybe more than one)
Added a bunch of debug code. It seems to work but needs more testsing.

Fixed a small bug in constant.py