Fixed session.serializer_handler to keep previous value with invalid ini_set

Added tests and fix so that session.serialize_handler returns last set value after ini_set is called with an invalid serialize handler.