SERVER-14806: Improve get_ipaddr parsing in JS tests

Closes #741

Signed-off-by: Benety Goh <benety@mongodb.com>