Fixed `==` for PTables, added test.

`==` in tables.nim didn't compile for PTables. I fixed that and added a nil check for both parameters.