Repository: pinojs/pino (js)

Issue:
obj.hasOwnProperty is not a function
Found this deep inside our server logs

```
obj.hasOwnProperty is not a function
    at EventEmitter.asJson (/Users/ronagy/Projects/github/nxtedition/nxt-storage/node_modules/pino/pino.js:175:15)
    at EventEmitter.Pino.write (/Users/ronagy/Projects/github/nxtedition/nxt-storage/node_modules/pino/pino.js:224:16)
    at EventEmitter.LOG (/Users/ronagy/Projects/github/nxtedition/nxt-storage/node_modules/pino/lib/tools.js:116:10)
```

Not sure how to reproduce it.

Pull request description:
fix for null proto closes #180
Master:

Pino average: 271.8075
PinoExreme average: 132.1225

Branch: 

Pino average: 271.576
PinoExreme average: 135.951



Patch:
diff --git a/pino.js b/pino.js
index cf6de2b..04c0edc 100644
--- a/pino.js
+++ b/pino.js
@@ -172,7 +172,7 @@ Pino.prototype.asJson = function asJson (obj, msg, num) {
     }
     for (var key in obj) {
       value = obj[key]
-      if (obj.hasOwnProperty(key) && value !== undefined) {
+      if ((!obj.hasOwnProperty || obj.hasOwnProperty(key)) && value !== undefined) {
         value = this.stringify(this.serializers[key] ? this.serializers[key](value) : value)
         if (value !== undefined) {
           data += ',"' + key + '":' + value


Test patch:
diff --git a/test/basic.test.js b/test/basic.test.js
index 3ff7978..001fb27 100644
--- a/test/basic.test.js
+++ b/test/basic.test.js
@@ -377,3 +377,21 @@ test('normalize number to string with an object', function (t) {
 
   instance.info({ answer: 42 }, 1)
 })
+
+test('handles objects with null prototype', function (t) {
+  var instance = pino(sink(function (chunk, enc, cb) {
+    delete chunk.time
+    t.deepEqual(chunk, {
+      pid: pid,
+      hostname: hostname,
+      level: 30,
+      test: 'test',
+      v: 1
+    })
+    t.end()
+    cb()
+  }))
+  var o = Object.create(null)
+  o.test = 'test'
+  instance.info(o)
+})