Adding a validate method on the hash to check for the uniqueness of the keys

We are validating keys in the hash to make sure they are unique. Without enforcing validation the last value of the key will be used.
Config:
```
filter {
  grok {
    match => [
      "message", "pattern1"
      ,"message", "pattern2"
      ,"message", "pattern3"
    ]
  }
}
```

Will show to the user:
```
Error: Duplicated keys found in config file: [message] at line: 3, column 17 (byte [37]) after filter {
  example {
    "switch" => {
```

This fix also check for deep nested hash..

Fixes: #2197
@ph can we add a test that it allows the right syntax 
` "message" => ["pattern1", "pattern2", "pattern3"]`