Support Android TrafficStats socket tagging.

Closes #837.