Throw TypeError when trying to serialize native built-in functions

This changes the serialization process of functions to throw when a native built-in function is trying to be serialized.