fix exception 

fix for exception when exit(null) in exports.main function.
exception msg is below
"err":{"message":"Cannot read property 'error' of null","name":"TypeError","stack":"TypeError: Cannot read property 'error' of null\n    at Script.onExit (/mnt/test/app/node_modules/sandcastle/lib/script.js:107:19)\n    at BufferStream.<anonymous> (/mnt/test/app/node_modules/sandcastle/lib/script.js:85:13)\n    at BufferStream.emit (events.js:98:17)\n    at BufferStream.split (/mnt/test/app/node_modules/sandcastle/node_modules/bufferstream/lib/buffer-stream.js:42:12)\n    at BufferStream.write (/mnt/test/app/node_modules/sandcastle/node_modules/bufferstream/lib/buffer-stream.js:210:17)\n    at BufferStream.write (/mnt/test/app/node_modules/sandcastle/node_modules/bufferstream/lib/buffer-stream.js:3:61)\n    at Socket.<anonymous> (/mnt/test/app/node_modules/sandcastle/lib/script.js:90:14)\n    at Socket.emit (events.js:95:17)\n    at Socket.<anonymous> (_stream_readable.js:748:14)\n    at Socket.emit (events.js:92:17)"},"msg":"Cannot read property 'error' of null","time":"2014-10-05T09:10:13.992Z","v":0}
add test for exit(null) in main function
Merge pull request #42 from 86chenjie/master

fix exception