Allow overriding the warn handler.