Fixed NULL handling problem for timestamps, backport HIVE-4122

Fixed problem with NULL handling load files and in database tables.