Not necessary since, as you've observed, this happens automatically on exit of the owning process.
I usually make the effort to do it anyway in case I change my code down the road in a way that doesn't have the process exiting at that same point. For example, open a socket, read data, then do a giant calc. Would leave the socket open for a long time if the calc was big.
Pretty sure I've ever actually run in to that situation, but I'm sure I won't if I always explicitly close my socket at the earliest point that makes sense.