Fixes OID warnings when using PostgreSQL

Postgres correctly identifies OIDs when BEARING and DISTANCE contain
numerical values. It fails to identify OID for a NULL type.

This patch explicitly sets an OID type for NULLs when running in
PostgreSQL environment.
adds null_value method for code reuse
Merge pull request #734 from jzelenkov/fix_postgres_oid_warnings

Fixes OID warnings when using PostgreSQL