Fix return value when p->peeked is true
When p->peeked is true it's possible for the return value of js_socket_recv to be off-by-one.
This change moves the total += ret
line before the MSG-WAITALL
check, and then returns total
instead of ret
to ensure the peeked byte is accounted for in the return value.