Safe haven demand drove gold and the yen while stocks were pressured after North Korea said it tested a hydrogen bomb.