Set SO_REUSEADDR option to TRUE for ServerSocket to enable easy server restarts, handle nulls in safeClose() and stopThreads() properly.