ref FOS-11: fix possible NPE while closing the manager

Summary:
If an error occurs while setting up the WekaManager's server sockets an error
occured when closing the manager.

Test Plan: Unit tests working

Reviewers: ricardo.ferreira

Reviewed By: ricardo.ferreira

Subscribers: deag

Differential Revision: https://review.feedzai.com/D1242