Add tests for socket:close closes #360