Avoid core dump if rpc port is in use.
Avoid core dump if rpc port is in use.

The cleanup code needs to check for NULL rpcworkers thread group.

Rebased-from: b7f6e156462a24129078252a4e957a5be622ebcc 0.8.x

Cannacoin-Project/Cannacoin,reddink/reddcoin,reddink/reddcoin,coinkeeper/2015-06-22_18-46_reddcoin,ahmedbodi/poscoin,coinkeeper/2015-06-22_19-10_cannacoin,Cannacoin-Project/Cannacoin,reddink/reddcoin,reddcoin-project/reddcoin,joroob/reddcoin,reddink/reddcoin,reddcoin-project/reddcoin,bmp02050/ReddcoinUpdates,ahmedbodi/poscoin,Cannacoin-Project/Cannacoin,coinkeeper/2015-06-22_19-10_cannacoin,coinkeeper/2015-06-22_18-46_reddcoin,bmp02050/ReddcoinUpdates,joroob/reddcoin,joroob/reddcoin,ahmedbodi/poscoin,coinkeeper/2015-06-22_19-10_cannacoin,bmp02050/ReddcoinUpdates,bmp02050/ReddcoinUpdates,Cannacoin-Project/Cannacoin,joroob/reddcoin,reddcoin-project/reddcoin,coinkeeper/2015-06-22_18-46_reddcoin,coinkeeper/2015-06-22_18-46_reddcoin,bmp02050/ReddcoinUpdates,coinkeeper/2015-06-22_18-46_reddcoin,coinkeeper/2015-06-22_19-10_cannacoin,reddcoin-project/reddcoin,coinkeeper/2015-06-22_19-10_cannacoin,reddcoin-project/reddcoin,reddink/reddcoin,Cannacoin-Project/Cannacoin,ahmedbodi/poscoin,joroob/reddcoin,ahmedbodi/poscoin,reddcoin-project/reddcoin