lib/socket: fix call to enlarge with actual buffer usage