nat_traversal: use local variable for port and proto on keepalive resolve

- safe execution for those resolving functions expecting PROTO_NONE
- reported by Jason Penton, FS#491
core: safety checks on proto variable for dsn resolving

- avoid crashes if functions used inadequately with a null pointer