Make sure we BoostFunction can be serialized without filter

The filter is optional in the BoostFunction, but serialization failed when it was None.