Some bugs fixed.

Some exceptions that caused by cloudpickle should be ignored.
Spartan should call master.shutdown() when the program terminates.