minor refactor to make sure there're no dangling sockets and files
aps_data -> apns_data; it should be more intuitive now