Close sockets on app close

Signed-off-by: Frca <killerfrca@gmail.com>